Merge pull request #114 from OdyX/dev-update-cmake-with-data

Let CMake rely on data's CMakeLists.txt if it exists
dev-ui
krzys-h 2013-01-09 04:36:06 -08:00
commit 871542abf5
2 changed files with 13 additions and 10 deletions

View File

@ -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)

2
data

@ -1 +1 @@
Subproject commit 6b6e5a0ab56bf42f17d969c1bd4c09185605cad6
Subproject commit 5a991a77eb5f476d29b4d4f976be48fdf74a053f