From e062b74a3a0081e07527ffdbf1256d775a41bce1 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Mon, 17 Dec 2012 10:11:56 +0100 Subject: Install libCBot to a private directory closes #90 - Make it configurable; - Move stanzas above the src directory inclusion, otherwise the value doesn't propagate. --- CMakeLists.txt | 6 ++++-- src/CBot/CMakeLists.txt | 2 +- src/CMakeLists.txt | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5238c1e..b60ac93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,9 +159,11 @@ if(${TESTS}) endif() +# TODO: provide data files as git submodule +set(COLOBOT_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/games/colobot CACHE PATH "Colobot shared data directory") +set(COLOBOT_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/colobot CACHE PATH "Colobot libraries directory") + # Subdirectory with sources add_subdirectory(src bin) -# TODO: provide data files as git submodule -set(COLOBOT_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/games/colobot CACHE PATH "Colobot shared data directory") install(DIRECTORY ../data DESTINATION ${COLOBOT_DATA_DIR}) diff --git a/src/CBot/CMakeLists.txt b/src/CBot/CMakeLists.txt index 271f2ce..12d7262 100644 --- a/src/CBot/CMakeLists.txt +++ b/src/CBot/CMakeLists.txt @@ -18,4 +18,4 @@ else() add_library(CBot SHARED ${SOURCES}) endif() -INSTALL_TARGETS(/lib CBot) +install(TARGETS CBot LIBRARY DESTINATION "${COLOBOT_LIB_DIR}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4ffacd3..a7f3441 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -195,4 +195,5 @@ add_executable(colobot ${SOURCES}) target_link_libraries(colobot ${LIBS}) -install_targets(/games colobot) +install(TARGETS colobot RUNTIME DESTINATION games/) +set_target_properties(colobot PROPERTIES INSTALL_RPATH ${COLOBOT_LIB_DIR}) -- cgit v1.2.3-1-g7c22