FindJPEG.cmake 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #.rst:
  2. # FindJPEG
  3. # --------
  4. #
  5. # Find JPEG
  6. #
  7. # Find the native JPEG includes and library This module defines
  8. #
  9. # ::
  10. #
  11. # JPEG_INCLUDE_DIRS, where to find jpeglib.h, etc.
  12. # JPEG_LIBRARIES, the libraries needed to use JPEG.
  13. # JPEG_FOUND, If false, do not try to use JPEG.
  14. #
  15. # also defined, but not for general use are
  16. #
  17. # ::
  18. #
  19. # JPEG_LIBRARY, where to find the JPEG library.
  20. #=============================================================================
  21. # Copyright 2001-2009 Kitware, Inc.
  22. #
  23. # Distributed under the OSI-approved BSD License (the "License");
  24. # see accompanying file Copyright.txt for details.
  25. #
  26. # This software is distributed WITHOUT ANY WARRANTY; without even the
  27. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  28. # See the License for more information.
  29. #=============================================================================
  30. # (To distribute this file outside of CMake, substitute the full
  31. # License text for the above reference.)
  32. find_path(JPEG_INCLUDE_DIR jpeglib.h)
  33. set(JPEG_NAMES ${JPEG_NAMES} jpeg)
  34. find_library(JPEG_LIBRARY NAMES ${JPEG_NAMES} )
  35. # handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
  36. # all listed variables are TRUE
  37. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  38. FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
  39. if(JPEG_FOUND)
  40. set(JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR})
  41. set(JPEG_LIBRARIES ${JPEG_LIBRARY})
  42. endif()
  43. mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIRS )