summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2022-05-07 10:23:26 +0200
committerGitHub <noreply@github.com>2022-05-07 10:23:26 +0200
commit7b474e6d815900eeebcaf03e44d8d076e3ee900a (patch)
tree085c252bd52b96fb2990d26d880148fae32cd3c2
parent6a29f5a9e3a1e2dbf1e3df22b7e449bc1db20b5c (diff)
parente33944ea9e4aaf5763d4b2b25cc97cc021989948 (diff)
Merge pull request #1410 from rouault/fix_1404
CMakeLists.txt: do not set INSTALL_NAME_DIR for MacOS builds for CMake >= 3.0 (fixes #1404)
-rw-r--r--CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 52af465a..20717722 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,7 +156,12 @@ if(NOT OPENJPEG_INSTALL_PACKAGE_DIR)
endif()
if (APPLE)
- list(APPEND OPENJPEG_LIBRARY_PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${OPENJPEG_INSTALL_LIB_DIR}")
+ if (${CMAKE_VERSION} VERSION_LESS 3.0)
+ # For cmake >= 3.0, we turn on CMP0042 and
+ # https://cmake.org/cmake/help/v3.0/policy/CMP0042.html mentions
+ # "Projects wanting @rpath in a target’s install name may remove any setting of the INSTALL_NAME_DIR and CMAKE_INSTALL_NAME_DIR variables"
+ list(APPEND OPENJPEG_LIBRARY_PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${OPENJPEG_INSTALL_LIB_DIR}")
+ endif()
option(OPJ_USE_DSYMUTIL "Call dsymutil on binaries after build." OFF)
endif()