ENH: make this work for older versions of OSX
[cmake.git] / Modules / FindJPEG.cmake
blob984929448502f2a0dedab3ecb4d82a75e73b9cca
1 # - Find JPEG
2 # Find the native JPEG includes and library
3 # This module defines
4 #  JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
5 #  JPEG_LIBRARIES, the libraries needed to use JPEG.
6 #  JPEG_FOUND, If false, do not try to use JPEG.
7 # also defined, but not for general use are
8 #  JPEG_LIBRARY, where to find the JPEG library.
10 FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h)
12 SET(JPEG_NAMES ${JPEG_NAMES} jpeg)
13 FIND_LIBRARY(JPEG_LIBRARY NAMES ${JPEG_NAMES} )
15 # handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if 
16 # all listed variables are TRUE
17 INCLUDE(FindPackageHandleStandardArgs)
18 FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
20 IF(JPEG_FOUND)
21   SET(JPEG_LIBRARIES ${JPEG_LIBRARY})
22 ENDIF(JPEG_FOUND)
24 # Deprecated declarations.
25 SET (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
26 IF(JPEG_LIBRARY)
27   GET_FILENAME_COMPONENT (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
28 ENDIF(JPEG_LIBRARY)
30 MARK_AS_ADVANCED(JPEG_LIBRARY JPEG_INCLUDE_DIR )