Commit c6e35c87 authored by Simon Spannagel's avatar Simon Spannagel Committed by Jens Kroeger
Browse files

CMake: resolve macOS RPATH issues

(cherry picked from commit 1f371066)
parent addcb408
......@@ -65,7 +65,9 @@ ENDIF()
# Set up the RPATH so executables find the libraries even when installed in non-default location
SET(CMAKE_MACOSX_RPATH TRUE)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_SKIP_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
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
......@@ -76,6 +78,11 @@ IF("${IsSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
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("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