Merge branch 'detrate/feature/encode-demos' into 'master'
[xonotic/xonotic.git] / CMakeLists.txt
index c1e0adb8e603a992640efbf0b21478e8c2d7651c..e5f53a214087c9adbbb9764a6c445b09358fea2f 100644 (file)
@@ -1,14 +1,29 @@
-cmake_minimum_required(VERSION 2.8.11)
+cmake_minimum_required(VERSION 2.8.11 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}
-        )
+macro(subproject name)
+    if (EXISTS "${PROJECT_SOURCE_DIR}/${name}/CMakeLists.txt")
+        add_subdirectory(${name} ${ARGN})
+    endif ()
+endmacro()
 
-include(release.cmake)
+subproject(daemon)
+subproject(d0_blind_id)
+subproject(darkplaces)
+subproject(data/xonotic-data.pk3dir)
+subproject(gmqcc)
+subproject(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 ()