FindJasper.cmake 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # - Try to find the Jasper JPEG2000 library
  2. # Once done this will define
  3. #
  4. # JASPER_FOUND - system has Jasper
  5. # JASPER_INCLUDE_DIR - the Jasper include directory
  6. # JASPER_LIBRARIES - The libraries needed to use Jasper
  7. #=============================================================================
  8. # Copyright 2006-2009 Kitware, Inc.
  9. # Copyright 2006 Alexander Neundorf <[email protected]>
  10. #
  11. # Distributed under the OSI-approved BSD License (the "License");
  12. # see accompanying file Copyright.txt for details.
  13. #
  14. # This software is distributed WITHOUT ANY WARRANTY; without even the
  15. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16. # See the License for more information.
  17. #=============================================================================
  18. # (To distributed this file outside of CMake, substitute the full
  19. # License text for the above reference.)
  20. FIND_PACKAGE(JPEG)
  21. IF (JASPER_INCLUDE_DIR AND JASPER_LIBRARIES AND JPEG_LIBRARIES)
  22. # Already in cache, be silent
  23. SET(Jasper_FIND_QUIETLY TRUE)
  24. ENDIF (JASPER_INCLUDE_DIR AND JASPER_LIBRARIES AND JPEG_LIBRARIES)
  25. FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h)
  26. FIND_LIBRARY(JASPER_LIBRARY NAMES jasper libjasper)
  27. IF (JASPER_INCLUDE_DIR AND JASPER_LIBRARY AND JPEG_LIBRARIES)
  28. SET(JASPER_LIBRARIES ${JASPER_LIBRARY} ${JPEG_LIBRARIES} )
  29. ENDIF (JASPER_INCLUDE_DIR AND JASPER_LIBRARY AND JPEG_LIBRARIES)
  30. # handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if
  31. # all listed variables are TRUE
  32. INCLUDE(FindPackageHandleStandardArgs)
  33. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper DEFAULT_MSG JASPER_LIBRARY JASPER_INCLUDE_DIR JPEG_LIBRARIES)
  34. IF (JASPER_FOUND)
  35. SET(JASPER_LIBRARIES ${JASPER_LIBRARY} ${JPEG_LIBRARIES} )
  36. ENDIF (JASPER_FOUND)
  37. MARK_AS_ADVANCED(JASPER_INCLUDE_DIR JASPER_LIBRARIES JASPER_LIBRARY)