summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorkrzys-h <krzys_h@interia.pl>2013-01-09 04:36:06 -0800
committerkrzys-h <krzys_h@interia.pl>2013-01-09 04:36:06 -0800
commit871542abf5c0f82d196a9cdb4ffcf5a9ac1b064c (patch)
tree8166bc511a134045801a2224693971c3de4c32d1 /CMakeLists.txt
parent9a9cfc51c19c6ff5191c84558640a63aeec71dbc (diff)
parentffb4d9ff4fbee5c96ff7828044e9002d85843b6a (diff)
downloadcolobot-871542abf5c0f82d196a9cdb4ffcf5a9ac1b064c.tar.gz
colobot-871542abf5c0f82d196a9cdb4ffcf5a9ac1b064c.tar.bz2
colobot-871542abf5c0f82d196a9cdb4ffcf5a9ac1b064c.zip
Merge pull request #114 from OdyX/dev-update-cmake-with-data
Let CMake rely on data's CMakeLists.txt if it exists
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 12 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e19ba0..674c627 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -202,11 +202,11 @@ if(${TESTS})
endif()
# Installation paths defined before compiling sources
-set(COLOBOT_INSTALL_BIN_DIR games CACHE PATH "Colobot binary directory")
-set(COLOBOT_INSTALL_DATA_DIR share/games/colobot CACHE PATH "Colobot shared data directory")
-set(COLOBOT_INSTALL_LIB_DIR lib/colobot CACHE PATH "Colobot libraries directory")
-set(COLOBOT_INSTALL_DOC_DIR share/doc/colobot CACHE PATH "Colobot documentation directory")
-set(COLOBOT_INSTALL_I18N_DIR share/locale CACHE PATH "Colobot translations directory")
+set(COLOBOT_INSTALL_BIN_DIR ${CMAKE_INSTALL_PREFIX}/games CACHE PATH "Colobot binary directory")
+set(COLOBOT_INSTALL_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/games/colobot CACHE PATH "Colobot shared data directory")
+set(COLOBOT_INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/colobot CACHE PATH "Colobot libraries directory")
+set(COLOBOT_INSTALL_DOC_DIR ${CMAKE_INSTALL_PREFIX}/share/doc/colobot CACHE PATH "Colobot documentation directory")
+set(COLOBOT_INSTALL_I18N_DIR ${CMAKE_INSTALL_PREFIX}/share/locale CACHE PATH "Colobot translations directory")
# Subdirectory with sources
add_subdirectory(src bin)
@@ -216,10 +216,13 @@ add_subdirectory(src bin)
# Installation
##
-file(GLOB DATA_FILES "data/*")
-
-# Data
-install(DIRECTORY data/ DESTINATION ${COLOBOT_INSTALL_DATA_DIR})
+# Data: check if the submodule handles its own installation
+if(EXISTS "${CMAKE_SOURCE_DIR}/data/CMakeLists.txt")
+ message(STATUS "Data directory will install itself.")
+ add_subdirectory(data)
+else()
+ message(WARNING "Data directory is not available; make sure colobot-data is installed in ${COLOBOT_INSTALL_DATA_DIR}.")
+endif()
# Documentation
if(INSTALL_DOCS AND DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)