FindJPEG.cmake 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #=============================================================================
  10. # Copyright 2001-2009 Kitware, Inc.
  11. #
  12. # Distributed under the OSI-approved BSD License (the "License");
  13. # see accompanying file Copyright.txt for details.
  14. #
  15. # This software is distributed WITHOUT ANY WARRANTY; without even the
  16. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. # See the License for more information.
  18. #=============================================================================
  19. # (To distributed this file outside of CMake, substitute the full
  20. # License text for the above reference.)
  21. FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h)
  22. SET(JPEG_NAMES ${JPEG_NAMES} jpeg)
  23. FIND_LIBRARY(JPEG_LIBRARY NAMES ${JPEG_NAMES} )
  24. # handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
  25. # all listed variables are TRUE
  26. INCLUDE(FindPackageHandleStandardArgs)
  27. FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
  28. IF(JPEG_FOUND)
  29. SET(JPEG_LIBRARIES ${JPEG_LIBRARY})
  30. ENDIF(JPEG_FOUND)
  31. # Deprecated declarations.
  32. SET (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
  33. IF(JPEG_LIBRARY)
  34. GET_FILENAME_COMPONENT (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
  35. ENDIF(JPEG_LIBRARY)
  36. MARK_AS_ADVANCED(JPEG_LIBRARY JPEG_INCLUDE_DIR )