X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=CMakeLists.txt;h=e63f71f6654983d9ed0195700ec4070da685694f;hp=c1e0adb8e603a992640efbf0b21478e8c2d7651c;hb=cf8cc7e9f8ac5457b6165198999dd3fd9ba33941;hpb=7e4acc7c3505ed5cedcf1dbc7a71d3adcd39f8a4 diff --git a/CMakeLists.txt b/CMakeLists.txt index c1e0adb8..e63f71f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,32 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) project(xonotic) -add_subdirectory(darkplaces) -add_subdirectory(data/xonotic-data.pk3dir) -add_subdirectory(gmqcc) -add_subdirectory(netradiant) +option(DOWNLOAD_MAPS "Download new maps from the build server" ON) +option(BUILD_RELEASE "Package a release" OFF) -add_custom_target(update-maps ALL - COMMAND ${PROJECT_SOURCE_DIR}/misc/tools/xonotic-map-compiler-autobuild download - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - ) +function(subproject id name) + if ($ENV{XON_NO_${id}}) + return() + endif () + if (EXISTS "${PROJECT_SOURCE_DIR}/${name}/CMakeLists.txt") + add_subdirectory(${name} ${ARGN}) + endif () +endfunction() -include(release.cmake) +subproject(DAEMON daemon) +subproject(PKI d0_blind_id) +subproject(DP darkplaces) +subproject(DATA data/xonotic-data.pk3dir) +subproject(QCC gmqcc) +subproject(RADIANT netradiant) + +if (DOWNLOAD_MAPS) + add_custom_target(update-maps ALL + COMMAND ${PROJECT_SOURCE_DIR}/misc/tools/xonotic-map-compiler-autobuild download + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + ) +endif () + +if (BUILD_RELEASE) + include(release.cmake) +endif ()