FindJPEG.cmake 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #.rst:
  4. # FindJPEG
  5. # --------
  6. #
  7. # Find JPEG
  8. #
  9. # Find the native JPEG includes and library This module defines
  10. #
  11. # ::
  12. #
  13. # JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
  14. # JPEG_LIBRARIES, the libraries needed to use JPEG.
  15. # JPEG_FOUND, If false, do not try to use JPEG.
  16. #
  17. # also defined, but not for general use are
  18. #
  19. # ::
  20. #
  21. # JPEG_LIBRARY, where to find the JPEG library.
  22. find_path(JPEG_INCLUDE_DIR jpeglib.h)
  23. set(JPEG_NAMES ${JPEG_NAMES} jpeg libjpeg)
  24. find_library(JPEG_LIBRARY NAMES ${JPEG_NAMES} )
  25. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  26. FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
  27. if(JPEG_FOUND)
  28. set(JPEG_LIBRARIES ${JPEG_LIBRARY})
  29. endif()
  30. # Deprecated declarations.
  31. set (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
  32. if(JPEG_LIBRARY)
  33. get_filename_component (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
  34. endif()
  35. mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIR )