Use relative RPATH paths

This commit is contained in:
Allen Byrne 2018-09-26 09:39:32 -05:00
parent ab84c029c4
commit 01e40b31fe

View File

@ -358,6 +358,16 @@ macro (HDF_DIR_PATHS package_prefix)
endif () endif ()
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}") if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}")
set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH}) set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH})
endif () endif ()