Commit 1f371066 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

CMake: resolve macOS RPATH issues

parent b8ea0390
...@@ -65,7 +65,9 @@ ENDIF() ...@@ -65,7 +65,9 @@ ENDIF()
# Set up the RPATH so executables find the libraries even when installed in non-default location # Set up the RPATH so executables find the libraries even when installed in non-default location
SET(CMAKE_MACOSX_RPATH TRUE) SET(CMAKE_MACOSX_RPATH TRUE)
SET(CMAKE_SKIP_BUILD_RPATH FALSE) SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_SKIP_INSTALL_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
# Add the automatically determined parts of the RPATH which point to directories outside the build tree to the install RPATH # Add the automatically determined parts of the RPATH which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
...@@ -76,6 +78,11 @@ IF("${IsSystemDir}" STREQUAL "-1") ...@@ -76,6 +78,11 @@ IF("${IsSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
ENDIF("${IsSystemDir}" STREQUAL "-1") ENDIF("${IsSystemDir}" STREQUAL "-1")
IF(APPLE)
SET(CMAKE_INSTALL_NAME_DIR "@rpath")
SET(CMAKE_INSTALL_RPATH "@loader_path/../lib") # self relative LIBDIR
ENDIF()
# Include corry cmake functions # Include corry cmake functions
INCLUDE("cmake/corryvreckan.cmake") INCLUDE("cmake/corryvreckan.cmake")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment