X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=20717722e8a64134d46c7cf723bb8f6e2e6a94d2;hb=ef36cd015efcef463fdd8ba13f4b4598cfe3aa25;hp=895fd6b0ecfb4e0b6cad50c78897e76281e6f069;hpb=cc1919b183f76d5ac79cc9927fb899b47700d925;p=openjpeg.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 895fd6b0..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() @@ -305,7 +310,7 @@ if(BUILD_DOC) endif() #----------------------------------------------------------------------------- -# Buld Testing +# Build Testing option(BUILD_TESTING "Build the tests." OFF) if(BUILD_TESTING) if(BUILD_CODEC)