File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,26 @@ SET(INSTALL_INC_DIR ${CMAKE_INSTALL_PREFIX}/include)
3232SET (INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX} /lib)
3333SET (INSTALL_CMAKE_DIR ${CMAKE_INSTALL_PREFIX} /cmake)
3434
35+ # setup for rpath and mac on the shoulders of O2 CMake
36+ include (GNUInstallDirs)
37+ if (APPLE )
38+ set (basePoint @loader_path)
39+ else ()
40+ set (basePoint $ORIGIN)
41+ endif ()
42+ set (CMAKE_SKIP_BUILD_RPATH FALSE )
43+ if (APPLE )
44+ set (CMAKE_BUILD_WITH_INSTALL_RPATH TRUE )
45+ endif ()
46+
47+ # add to the install RPATH the (automatically determined) parts of the RPATH
48+ # that point to directories outside the build tree
49+ set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE )
50+
51+ # specify libraries directory relative to binaries one.
52+ file (RELATIVE_PATH relDir ${INSTALL_BIN_DIR} ${INSTALL_LIB_DIR} )
53+ set (CMAKE_INSTALL_RPATH ${basePoint} ${basePoint} /${relDir} )
54+
3555#################################
3656# Whether or not to build tests #
3757#################################
You can’t perform that action at this time.
0 commit comments