From ecd70f033cbc0cc1663004522277ebed4c9d9a3d Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Mon, 21 Jun 2010 13:54:49 +0000 Subject: Start using cmake API for easy packaging --- CMake/OpenJPEGConfig.cmake.in | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 CMake/OpenJPEGConfig.cmake.in (limited to 'CMake') diff --git a/CMake/OpenJPEGConfig.cmake.in b/CMake/OpenJPEGConfig.cmake.in new file mode 100644 index 00000000..d2e63417 --- /dev/null +++ b/CMake/OpenJPEGConfig.cmake.in @@ -0,0 +1,48 @@ +#----------------------------------------------------------------------------- +# +# OPENJPEGConfig.cmake - CMake configuration file for external projects. +# +# This file is configured by OPENJPEG and used by the UseOPENJPEG.cmake +# module to load OPENJPEG's settings for an external project. +@OPENJPEG_CONFIG_INSTALL_ONLY@ +# The OPENJPEG version number. +SET(OPENJPEG_MAJOR_VERSION "@OPENJPEG_VERSION_MAJOR@") +SET(OPENJPEG_MINOR_VERSION "@OPENJPEG_VERSION_MINOR@") +SET(OPENJPEG_BUILD_VERSION "@OPENJPEG_VERSION_BUILD@") + +# The libraries. +SET(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARIES@") + +# The CMake macros dir. +SET(OPENJPEG_CMAKE_DIR "@OPENJPEG_CMAKE_DIR_CONFIG@") + +# The configuration options. +SET(OPENJPEG_BUILD_SHARED_LIBS "@OPENJPEG_BUILD_SHARED_LIBS@") + +# The "use" file. +SET(OPENJPEG_USE_FILE "@OPENJPEG_USE_FILE_CONFIG@") + +get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +if(EXISTS ${SELF_DIR}/OPENJPEGTargets.cmake) + # This is an install tree + include(${SELF_DIR}/OPENJPEGTargets.cmake) + get_filename_component(OPENJPEG_INCLUDE_ROOT "${SELF_DIR}/../../@OPENJPEG_INSTALL_INCLUDE_DIR@" ABSOLUTE) + set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_ROOT}) + +else(EXISTS ${SELF_DIR}/OPENJPEGTargets.cmake) + if(EXISTS ${SELF_DIR}/OPENJPEGExports.cmake) + # This is a build tree + SET( OPENJPEG_INCLUDE_DIRS @OPENJPEG_INCLUDE_PATH@) + + include(${SELF_DIR}/OPENJPEGExports.cmake) + + else(EXISTS ${SELF_DIR}/OPENJPEGExports.cmake) + message(FATAL_ERROR "ooops") + endif(EXISTS ${SELF_DIR}/OPENJPEGExports.cmake) +endif(EXISTS ${SELF_DIR}/OPENJPEGTargets.cmake) + +set(OPENJPEG_USE_FILE ${SELF_DIR}/UseOPENJPEG.cmake) + +# Backward compatible part: +SET(OPENJPEG_FOUND TRUE) + -- cgit v1.2.3