From 1cc74b395eb8165afb04e5b842489671959ab544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 18 Mar 2011 20:10:22 +0100 Subject: [PATCH] Use RPATH tweaks on linux to make portable packages work --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b0fe42f6..5d86a4ff6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,9 @@ IF(${DFHACK_INSTALL} STREQUAL "portable") SET(DFHACK_DEVLIB_DESTINATION dev) SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .) ENDIF() + IF(UNIX) + SET(CMAKE_INSTALL_RPATH "$ORIGIN") + ENDIF() # documentation goes here: SET(DFHACK_USERDOC_DESTINATION .) SET(DFHACK_DEVDOC_DESTINATION dev) @@ -59,6 +62,11 @@ IF(${DFHACK_INSTALL} STREQUAL "portable") ENDIF() IF(${DFHACK_INSTALL} STREQUAL "linux") + if(WIN32) + MESSAGE(FATAL_ERROR "WTF are you doing?") + endif() + # set RPATH to always point at the dfhack lib using relative path. + SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/") # the dfhack libraries will be installed here: SET(DFHACK_LIBRARY_DESTINATION lib) # the dfhack tools will be installed here: