X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=CMakeLists.txt;h=23080598b53504e61e954830ad56295dc97b3c7f;hp=0dbabfbe8e680751ffd868efb22956a5851d3f50;hb=883e2b54db7e05149fcd5d4cfcf40ebd7181b29e;hpb=d3952c380ad6d5946bdf8d1061f39183f0f5cea0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dbabfbe..23080598 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +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) + +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() + +subproject(PKI d0_blind_id) +subproject(DAEMON daemon) +subproject(DP darkplaces) +subproject(QCC gmqcc) +subproject(RADIANT netradiant) +subproject(DATA data/xonotic-data.pk3dir) + +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 ()