|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:44:33
|
Module: performous
Branch: dance
Commit: 3900316c5796ec5e742d4de8c12da5cd3c176236
Author: Lasse Karkkainen <tro...@tr...>
Date: Thu Nov 12 17:42:27 2009 +0200
Relocation support for Apple (needs testing)
---
game/CMakeLists.txt | 11 +++++------
libs/libda/src/CMakeLists.txt | 2 +-
libs/plugin++/CMakeLists.txt | 2 +-
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index 83168b6..1ea641a 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -39,12 +39,11 @@ add_executable(performous ${SOURCES} ${SDL_SOURCES})
target_link_libraries(performous da ${LIBS})
# Store library paths in executable
-set_target_properties(performous PROPERTIES
- INSTALL_RPATH_USE_LINK_PATH TRUE
- SKIP_BUILD_RPATH FALSE
- INSTALL_RPATH \$ORIGIN/../lib
- BUILD_WITH_INSTALL_RPATH FALSE
-)
+if(APPLE)
+ set_target_properties(performous PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE INSTALL_RPATH @loader_path/../lib)
+else()
+ set_target_properties(performous PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE INSTALL_RPATH \$ORIGIN/../lib)
+endif()
# Generate config.hh
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.hh" "${CMAKE_CURRENT_BINARY_DIR}/config.hh" @ONLY)
diff --git a/libs/libda/src/CMakeLists.txt b/libs/libda/src/CMakeLists.txt
index 60061a0..ddfbf8a 100644
--- a/libs/libda/src/CMakeLists.txt
+++ b/libs/libda/src/CMakeLists.txt
@@ -7,5 +7,5 @@ find_package(Boost 1.34 REQUIRED COMPONENTS thread filesystem)
include_directories(${Boost_INCLUDE_DIRS})
add_library(da SHARED audio.cpp)
target_link_libraries(da plugin++ ${Boost_LIBRARIES})
-set_target_properties(da PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
+set_target_properties(da PROPERTIES INSTALL_NAME_DIR @rpath/lib)
install(TARGETS da DESTINATION lib${LIB_SUFFIX})
diff --git a/libs/plugin++/CMakeLists.txt b/libs/plugin++/CMakeLists.txt
index 1378e5a..7b84fcd 100644
--- a/libs/plugin++/CMakeLists.txt
+++ b/libs/plugin++/CMakeLists.txt
@@ -19,7 +19,7 @@ if(NOT WIN32)
target_link_libraries(plugin++ dl)
endif()
-set_target_properties(plugin++ PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
+set_target_properties(plugin++ PROPERTIES INSTALL_NAME_DIR @rpath/lib)
install(TARGETS plugin++ DESTINATION lib${LIB_SUFFIX})
FILE(GLOB HEADER_FILES "include/plugin++/*")
|