Merge branch 'lua_versions' into main/rendor-staging
[ryzomcore.git] / CMakeModules / FindJpeg.cmake
blobb77eba41baf6e4fffd4c31884086d008a021b956
1 # - Locate Jpeg library
2 # This module defines
3 #  JPEG_LIBRARY, the library to link against
4 #  JPEG_FOUND, if false, do not try to link to JPEG
5 #  JPEG_INCLUDE_DIR, where to find headers.
7 IF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
8   # in cache already
9   SET(JPEG_FIND_QUIETLY TRUE)
10 ENDIF()
13 FIND_PATH(JPEG_INCLUDE_DIR
14   jpeglib.h
15   PATHS
16   $ENV{JPEG_DIR}/include
17   /usr/local/include
18   /usr/include
19   /sw/include
20   /opt/local/include
21   /opt/csw/include
22   /opt/include
23   PATH_SUFFIXES jpeg
26 FIND_LIBRARY(JPEG_LIBRARY
27   NAMES jpeg libjpeg
28   PATHS
29   $ENV{JPEG_DIR}/lib
30   /usr/local/lib
31   /usr/lib
32   /usr/local/X11R6/lib
33   /usr/X11R6/lib
34   /sw/lib
35   /opt/local/lib
36   /opt/csw/lib
37   /opt/lib
38   /usr/freeware/lib64
41 IF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
42   SET(JPEG_FOUND "YES")
43   IF(NOT JPEG_FIND_QUIETLY)
44     MESSAGE(STATUS "Found Jpeg: ${JPEG_LIBRARY}")
45   ENDIF()
46 ELSE()
47   IF(NOT JPEG_FIND_QUIETLY)
48     MESSAGE(STATUS "Warning: Unable to find Jpeg!")
49   ENDIF()
50 ENDIF()