summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-11-16 11:39:36 +0100
committerDimitri Staessens <dimitri.staessens@ugent.be>2017-11-16 11:39:56 +0100
commitdb505a91d035b5942113c2eace2e356894f60fc8 (patch)
tree1f2ae20490717bfe9dd9ad41c1448f0520cb00b9 /CMakeLists.txt
parent4fc4cac512f990e1bfe0afc8a33f95a7d67d6762 (diff)
downloadouroboros-db505a91d035b5942113c2eace2e356894f60fc8.tar.gz
ouroboros-db505a91d035b5942113c2eace2e356894f60fc8.zip
build: Set correct rpath in non-sandboxed build
After the previous commits, the rpath was not being correctly set anymore for the sandboxed and non-sandboxed build. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 9 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3021c43a..1bfe590e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@ set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
- "Build type (Release, Debug, DebugASan, DebugTSan, DebugLSan)" FORCE)
+ "Build type (Release, Debug, DebugASan, DebugTSan, DebugLSan)" FORCE)
endif()
if (NOT APPLE AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
@@ -28,14 +28,20 @@ if (APPLE)
set(CMAKE_MACOSX_RPATH 1)
endif()
+if (CMAKE_INSTALL_PREFIX STREQUAL "/")
+ set(RPATH_PREFIX "")
+else ()
+ set(RPATH_PREFIX ${CMAKE_INSTALL_PREFIX})
+endif ()
+
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
- "${CMAKE_INSTALL_PREFIX}/usr/lib" isSystemDir)
+ "${RPATH_PREFIX}/usr/lib" isSystemDir)
IF ("${isSystemDir}" STREQUAL "-1")
- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/usr/lib")
+ set(CMAKE_INSTALL_RPATH "${RPATH_PREFIX}/usr/lib")
ENDIF ("${isSystemDir}" STREQUAL "-1")
message(STATUS "Package name is: ${PACKAGE_NAME}")