mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-12 17:31:09 +08:00
cmake: remove outdated rpath handling (#5271)
This commit is contained in:
parent
1725a2b463
commit
55bfec8f41
@ -169,26 +169,6 @@ macro (HDF_DIR_PATHS package_prefix)
|
||||
endif ()
|
||||
message(STATUS "Final: ${${package_prefix}_INSTALL_DOC_DIR}")
|
||||
|
||||
# Always use full RPATH, i.e. don't skip the full RPATH for the build tree
|
||||
set (CMAKE_SKIP_BUILD_RPATH OFF)
|
||||
# when building, don't use the install RPATH already
|
||||
# (but later on when installing)
|
||||
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH OFF)
|
||||
# add the automatically determined parts of the RPATH
|
||||
# which point to directories outside the build tree to the install RPATH
|
||||
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}"
|
||||
"@executable_path/"
|
||||
"@loader_path/../${${package_prefix}_INSTALL_LIB_DIR}"
|
||||
"@loader_path/"
|
||||
)
|
||||
else ()
|
||||
set (CMAKE_INSTALL_RPATH "\$ORIGIN/../${${package_prefix}_INSTALL_LIB_DIR}:\$ORIGIN/")
|
||||
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 ()
|
||||
|
@ -35,29 +35,6 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage)
|
||||
endif ()
|
||||
endif ()
|
||||
HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype})
|
||||
|
||||
#-- Apple Specific install_name for libraries
|
||||
if (APPLE)
|
||||
option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF)
|
||||
if (HDF5_BUILD_WITH_INSTALL_NAME)
|
||||
set_target_properties (${libtarget} PROPERTIES
|
||||
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
|
||||
BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME}
|
||||
)
|
||||
endif ()
|
||||
if (HDF5_BUILD_FRAMEWORKS)
|
||||
if (${libtype} MATCHES "SHARED")
|
||||
# adapt target to build frameworks instead of dylibs
|
||||
set_target_properties(${libtarget} PROPERTIES
|
||||
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
|
||||
FRAMEWORK TRUE
|
||||
FRAMEWORK_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}
|
||||
MACOSX_FRAMEWORK_IDENTIFIER org.hdfgroup.${libtarget}
|
||||
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${HDF5_PACKAGE_VERSION_MAJOR}
|
||||
MACOSX_FRAMEWORK_BUNDLE_VERSION ${HDF5_PACKAGE_VERSION_MAJOR})
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# Initialize the list of VFDs to be used for testing and create a test folder for each VFD
|
||||
|
@ -458,26 +458,6 @@ macro (HDF_DIR_PATHS package_prefix)
|
||||
endif ()
|
||||
message(STATUS "Final: ${${package_prefix}_INSTALL_DOC_DIR}")
|
||||
|
||||
# Always use full RPATH, i.e. don't skip the full RPATH for the build tree
|
||||
set (CMAKE_SKIP_BUILD_RPATH OFF)
|
||||
# when building, don't use the install RPATH already
|
||||
# (but later on when installing)
|
||||
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH OFF)
|
||||
# add the automatically determined parts of the RPATH
|
||||
# which point to directories outside the build tree to the install RPATH
|
||||
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}"
|
||||
"@executable_path/"
|
||||
"@loader_path/../${${package_prefix}_INSTALL_LIB_DIR}"
|
||||
"@loader_path/"
|
||||
)
|
||||
else ()
|
||||
set (CMAKE_INSTALL_RPATH "\$ORIGIN/../${${package_prefix}_INSTALL_LIB_DIR}:\$ORIGIN/")
|
||||
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 ()
|
||||
|
@ -73,7 +73,7 @@ if (APPLE)
|
||||
set (ENV{CC} "${XCODE_CC}")
|
||||
set (ENV{CXX} "${XCODE_CXX}")
|
||||
|
||||
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
|
||||
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON")
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
@ -73,7 +73,7 @@ if (APPLE)
|
||||
set (ENV{CC} "${XCODE_CC}")
|
||||
set (ENV{CXX} "${XCODE_CXX}")
|
||||
|
||||
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
|
||||
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON")
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
@ -380,7 +380,6 @@ IV. Further considerations
|
||||
Additional options:
|
||||
CMAKE_ANSI_CFLAGS:STRING=-fPIC
|
||||
CTEST_USE_LAUNCHERS:BOOL=ON
|
||||
CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF
|
||||
|
||||
5. Windows developers should install NSIS or WiX to create an install image with CPack.
|
||||
Visual Studio Express users will not be able to package HDF5 into
|
||||
|
Loading…
x
Reference in New Issue
Block a user