FindJPEG.cmake 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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.
  9. FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h
  10. /usr/local/include
  11. /usr/include
  12. )
  13. SET(JPEG_NAMES ${JPEG_NAMES} jpeg)
  14. FIND_LIBRARY(JPEG_LIBRARY
  15. NAMES ${JPEG_NAMES}
  16. PATHS /usr/lib /usr/local/lib
  17. )
  18. IF (JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
  19. SET(JPEG_LIBRARIES ${JPEG_LIBRARY})
  20. SET(JPEG_FOUND "YES")
  21. ELSE (JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
  22. SET(JPEG_FOUND "NO")
  23. ENDIF (JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
  24. IF (JPEG_FOUND)
  25. IF (NOT JPEG_FIND_QUIETLY)
  26. MESSAGE(STATUS "Found JPEG: ${JPEG_LIBRARIES}")
  27. ENDIF (NOT JPEG_FIND_QUIETLY)
  28. ELSE (JPEG_FOUND)
  29. IF (JPEG_FIND_REQUIRED)
  30. MESSAGE(FATAL_ERROR "Could not find JPEG library")
  31. ENDIF (JPEG_FIND_REQUIRED)
  32. ENDIF (JPEG_FOUND)
  33. # Deprecated declarations.
  34. SET (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
  35. GET_FILENAME_COMPONENT (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
  36. MARK_AS_ADVANCED(
  37. JPEG_LIBRARY
  38. JPEG_INCLUDE_DIR
  39. )