Skip to content

Commit

Permalink
Merge pull request #1140 from bukatlib/fix_relpath
Browse files Browse the repository at this point in the history
Relative path to header files is hardcoded in OpenJPEGConfig.cmake.in file
  • Loading branch information
rouault authored Sep 22, 2018
2 parents c6ee006 + 24fd3ce commit ccc4441
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmake/OpenJPEGConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ 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})

# 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}" ABSOLUTE)

else()
if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
Expand Down

0 comments on commit ccc4441

Please sign in to comment.