summaryrefslogtreecommitdiffstats
path: root/config/cmake_ext_mod/HDFMacros.cmake
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-09-26 14:39:32 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-09-26 14:40:03 (GMT)
commit01e40b31fe0b9fd318f5b6ceb00c6d46f7c91c9a (patch)
tree0542bca76d5ec4c720acd2514ca8f2ed08afec04 /config/cmake_ext_mod/HDFMacros.cmake
parentab84c029c492ce8c9d3bac8e03bf07e760de9cd7 (diff)
downloadhdf5-01e40b31fe0b9fd318f5b6ceb00c6d46f7c91c9a.zip
hdf5-01e40b31fe0b9fd318f5b6ceb00c6d46f7c91c9a.tar.gz
hdf5-01e40b31fe0b9fd318f5b6ceb00c6d46f7c91c9a.tar.bz2
Use relative RPATH paths
Diffstat (limited to 'config/cmake_ext_mod/HDFMacros.cmake')
-rw-r--r--config/cmake_ext_mod/HDFMacros.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake
index aa18022..bd9d62e 100644
--- a/config/cmake_ext_mod/HDFMacros.cmake
+++ b/config/cmake_ext_mod/HDFMacros.cmake
@@ -358,6 +358,16 @@ macro (HDF_DIR_PATHS package_prefix)
endif ()
endif ()
+ set (CMAKE_SKIP_BUILD_RPATH FALSE)
+ set (CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
+ set (CMAKE_BUILD_WITH_INSTALL_RPATH ON)
+ if (APPLE)
+ set (CMAKE_INSTALL_NAME_DIR "@rpath")
+ set (CMAKE_INSTALL_RPATH "@executable_path/../${${package_prefix}_INSTALL_LIB_DIR}")
+ else ()
+ set (CMAKE_INSTALL_RPATH "\$ORIGIN/../${${package_prefix}_INSTALL_LIB_DIR}")
+ endif ()
+
if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}")
set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH})
endif ()