From b74882f6e29448dc8a74b01f9e3de73afa8f20ad Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Fri, 2 Nov 2018 17:37:32 +0100 Subject: [PATCH] Replace OPENJPEG_INSTALL_INCLUDE_DIR with CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_FULL_INCLUDEDIR contains absolute path with CMAKE_INSTALL_PREFIX --- CMakeLists.txt | 4 ---- cmake/OpenJPEGConfig.cmake.in | 8 ++------ src/lib/openjp2/CMakeLists.txt | 4 ++-- src/lib/openjp2/libopenjp2.pc.cmake.in | 2 +- src/lib/openjpip/libopenjpip.pc.cmake.in | 2 +- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ae02616..90b342d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,10 +113,6 @@ option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF string(TOLOWER ${PROJECT_NAME} projectname) set(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}") -if(NOT OPENJPEG_INSTALL_INCLUDE_DIR) - set(OPENJPEG_INSTALL_INCLUDE_DIR "include/${OPENJPEG_INSTALL_SUBDIR}") -endif() - if(BUILD_DOC) if(NOT OPENJPEG_INSTALL_MAN_DIR) set(OPENJPEG_INSTALL_MAN_DIR "share/man/") diff --git a/cmake/OpenJPEGConfig.cmake.in b/cmake/OpenJPEGConfig.cmake.in index 6e88036c..fccd0cc6 100644 --- a/cmake/OpenJPEGConfig.cmake.in +++ b/cmake/OpenJPEGConfig.cmake.in @@ -27,12 +27,8 @@ if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) # This is an install tree include(${SELF_DIR}/OpenJPEGTargets.cmake) - # We find a relative path from the PKG directory to header files. - set(PKG_DIR "@CMAKE_INSTALL_PREFIX@/@OPENJPEG_INSTALL_PACKAGE_DIR@") - set(INC_DIR "@CMAKE_INSTALL_PREFIX@/@OPENJPEG_INSTALL_INCLUDE_DIR@") - file(RELATIVE_PATH PKG_TO_INC_RPATH "${PKG_DIR}" "${INC_DIR}") - - get_filename_component(OPENJPEG_INCLUDE_DIRS "${SELF_DIR}/${PKG_TO_INC_RPATH}" REALPATH) + set(INC_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@/@OPENJPEG_INSTALL_SUBDIR@") + get_filename_component(OPENJPEG_INCLUDE_DIRS "${INC_DIR}" ABSOLUTE) else() if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake) diff --git a/src/lib/openjp2/CMakeLists.txt b/src/lib/openjp2/CMakeLists.txt index b0bc53a4..cfb0651f 100644 --- a/src/lib/openjp2/CMakeLists.txt +++ b/src/lib/openjp2/CMakeLists.txt @@ -2,7 +2,7 @@ include_regular_expression("^.*$") # install( FILES ${CMAKE_CURRENT_BINARY_DIR}/opj_config.h - DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers) + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${OPENJPEG_INSTALL_SUBDIR} COMPONENT Headers) include_directories( ${${OPENJPEG_NAMESPACE}_BINARY_DIR}/src/lib/openjp2 # opj_config.h and opj_config_private.h @@ -124,7 +124,7 @@ install(TARGETS ${INSTALL_LIBS} # Install includes files install(FILES openjpeg.h opj_stdint.h - DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${OPENJPEG_INSTALL_SUBDIR} COMPONENT Headers ) if(BUILD_DOC) diff --git a/src/lib/openjp2/libopenjp2.pc.cmake.in b/src/lib/openjp2/libopenjp2.pc.cmake.in index 7cff8dee..dfb78020 100644 --- a/src/lib/openjp2/libopenjp2.pc.cmake.in +++ b/src/lib/openjp2/libopenjp2.pc.cmake.in @@ -3,7 +3,7 @@ bindir=${prefix}/@CMAKE_INSTALL_BINDIR@ mandir=${prefix}/@OPENJPEG_INSTALL_MAN_DIR@ docdir=${prefix}/@OPENJPEG_INSTALL_DOC_DIR@ libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ -includedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@OPENJPEG_INSTALL_SUBDIR@ Name: openjp2 Description: JPEG2000 library (Part 1 and 2) diff --git a/src/lib/openjpip/libopenjpip.pc.cmake.in b/src/lib/openjpip/libopenjpip.pc.cmake.in index 9698e79e..5b41cc1d 100644 --- a/src/lib/openjpip/libopenjpip.pc.cmake.in +++ b/src/lib/openjpip/libopenjpip.pc.cmake.in @@ -3,7 +3,7 @@ bindir=${prefix}/@CMAKE_INSTALL_BINDIR@ mandir=${prefix}/@OPENJPEG_INSTALL_MAN_DIR@ docdir=${prefix}/@OPENJPEG_INSTALL_DOC_DIR@ libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ -includedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@OPENJPEG_INSTALL_SUBDIR@ Name: openjpip Description: JPEG2000 Interactivity tools, APIs and protocols (Part 9)