summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2012-04-19 10:26:48 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2012-04-19 10:26:48 +0000
commit5379ec5715ffc69252a0a6a20a5db579e21f9fa2 (patch)
tree2c1cc46c8530070f277575d4ec9de427f916c7fb /CMake
parentb431cb0a41917d11d848d717e59403f45b673b8d (diff)
[1.5] Fix computation of relative path from include/ to lib/
Diffstat (limited to 'CMake')
-rw-r--r--CMake/OpenJPEGConfig.cmake.in8
1 files changed, 7 insertions, 1 deletions
diff --git a/CMake/OpenJPEGConfig.cmake.in b/CMake/OpenJPEGConfig.cmake.in
index 020ddfcc..00a98bd6 100644
--- a/CMake/OpenJPEGConfig.cmake.in
+++ b/CMake/OpenJPEGConfig.cmake.in
@@ -23,10 +23,16 @@ SET(OPENJPEG_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
SET(OPENJPEG_USE_FILE "@OPENJPEG_USE_FILE_CONFIG@")
get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+# The following is inspired from:
+# http://www.cmake.org/Wiki/CMake/Tutorials/Packaging#Packaging_and_Exporting
+# However the following is difficult to handle:
+# get_filename_component(myproj_INCLUDE_DIRS "${SELF_DIR}/../../include/myproj" ABSOLUTE)
+# it asssumes a non multi-arch system, where 'include' is located '../include' from lib
+# therefore we need to take into account the number of subdirs in OPENJPEG_INSTALL_LIB_DIR
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)
+ get_filename_component(OPENJPEG_INCLUDE_ROOT "${SELF_DIR}/@relative_parent@/@OPENJPEG_INSTALL_INCLUDE_DIR@" ABSOLUTE)
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_ROOT})
else(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)