OpenJPEGConfig.cmake 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #-----------------------------------------------------------------------------
  2. #
  3. # OPENJPEGConfig.cmake - CMake configuration file for external projects.
  4. #
  5. # This file is configured by OPENJPEG and used by the UseOPENJPEG.cmake
  6. # module to load OPENJPEG's settings for an external project.
  7. ####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
  8. ####### Any changes to this file will be overwritten by the next CMake run ####
  9. ####### The input file was OpenJPEGConfig.cmake.in ########
  10. get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
  11. macro(set_and_check _var _file)
  12. set(${_var} "${_file}")
  13. if(NOT EXISTS "${_file}")
  14. message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
  15. endif()
  16. endmacro()
  17. macro(check_required_components _NAME)
  18. foreach(comp ${${_NAME}_FIND_COMPONENTS})
  19. if(NOT ${_NAME}_${comp}_FOUND)
  20. if(${_NAME}_FIND_REQUIRED_${comp})
  21. set(${_NAME}_FOUND FALSE)
  22. endif()
  23. endif()
  24. endforeach()
  25. endmacro()
  26. ####################################################################################
  27. # The OPENJPEG version number.
  28. set(OPENJPEG_MAJOR_VERSION "2")
  29. set(OPENJPEG_MINOR_VERSION "5")
  30. set(OPENJPEG_BUILD_VERSION "2")
  31. # The libraries.
  32. set(OPENJPEG_LIBRARIES "openjp2")
  33. # The CMake macros dir.
  34. set(OPENJPEG_CMAKE_DIR "lib/cmake/openjpeg-2.5")
  35. # The configuration options.
  36. set(OPENJPEG_BUILD_SHARED_LIBS "ON")
  37. # The "use" file.
  38. set(OPENJPEG_USE_FILE "")
  39. get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
  40. if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
  41. # This is an install tree
  42. include(${SELF_DIR}/OpenJPEGTargets.cmake)
  43. set(INC_DIR "${PACKAGE_PREFIX_DIR}/include/openjpeg-2.5")
  44. get_filename_component(OPENJPEG_INCLUDE_DIRS "${INC_DIR}" ABSOLUTE)
  45. else()
  46. if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
  47. # This is a build tree
  48. set( OPENJPEG_INCLUDE_DIRS )
  49. include(${SELF_DIR}/OpenJPEGExports.cmake)
  50. else()
  51. message(FATAL_ERROR "ooops")
  52. endif()
  53. endif()
  54. set(OPENJPEG_USE_FILE ${SELF_DIR}/UseOPENJPEG.cmake)
  55. # Backward compatible part:
  56. set(OPENJPEG_FOUND TRUE)