CMAKE: improved disabling single components

master
Martin Gerhardy 2021-11-20 22:23:47 +01:00
parent 694a3f6495
commit da237683e3
4 changed files with 39 additions and 28 deletions

View File

@ -1,5 +1,35 @@
cmake_minimum_required(VERSION 3.10)
include(CMakeLists.local OPTIONAL)
option(UNITTESTS "Builds with unittests" ON)
option(VISUALTESTS "Builds with visual tests (src/tests)" ON)
option(GAMES "Builds with games (openworld)" ON)
option(OPENWORLD_SERVER "Builds with server (needs GAMES to be active)" ON)
option(OPENWORLD_CLIENT "Builds with client (needs GAMES to be active)" ON)
option(TOOLS "Builds with tools (voxedit, thumbnailer, voxconvert, mapview, aidebug)" ON)
option(VOXEDIT "Builds voxedit (needs TOOLS to be active)" ON)
option(THUMBNAILER "Builds thumbnailer (needs TOOLS to be active)" ON)
option(VOXCONVERT "Builds voxconvert (needs TOOLS to be active)" ON)
option(MAPVIEW "Builds mapview (needs TOOLS to be active)" ON)
option(AIDEBUG "Builds aidebug (needs TOOLS to be active)" ON)
option(DISABLE_UNITY "Disable the fast unity build" ON)
option(USE_CCACHE "Use ccache" ON)
option(USE_GPROF "Use gprof - will become slow" OFF)
option(USE_GCOV "Use gcov - will become slow" OFF)
option(USE_DOXYGEN_CHECK "Use -Wdocumentation if available" OFF)
option(USE_CPPCHECK "Enable cppcheck" OFF)
option(USE_CLANG_TIDY "Enable Clang Tidy" OFF)
option(USE_STACKTRACES "Enable stacktraces" ON)
set(PKGDATADIR "" CACHE STRING "System directory to search for data files (must end on /)")
set(DB_PW "engine" CACHE STRING "The database password (openworld server)")
set(SERVER_PORT "11337" CACHE STRING "Port where the server is listening on (openworld server)")
set(HTTP_SERVER_PORT "8080" CACHE STRING "Port where the http server is listening on (openworld server)")
set(DOCKER_REGISTRY "" CACHE STRING "Docker registry")
set(ROOT_PROJECT_MAJOR_VERSION 0)
set(ROOT_PROJECT_MINOR_VERSION 0)
set(ROOT_PROJECT_MICRO_VERSION 14)
@ -46,29 +76,6 @@ include(${SCRIPTS_CMAKE_DIR}/macros.cmake)
include(${SCRIPTS_CMAKE_DIR}/pack.cmake)
include(CPack)
option(UNITTESTS "Builds with tests" ON)
option(VISUALTESTS "Builds with visual tests" ON)
option(DISABLE_UNITY "Disable the fast unity build" ON)
option(TOOLS "Builds with tools" ON)
option(SERVER "Builds with server" ON)
option(CLIENT "Builds with client" ON)
option(VOXEDIT "Builds voxedit" ON)
option(THUMBNAILER "Builds thumbnailer" ON)
option(VOXCONVERT "Builds voxconvert" ON)
option(MAPVIEW "Builds mapview" ON)
option(USE_CCACHE "Use ccache" ON)
option(USE_GPROF "Use gprof - will become slow" OFF)
option(USE_GCOV "Use gcov - will become slow" OFF)
option(USE_DOXYGEN_CHECK "Use -Wdocumentation if available" OFF)
option(USE_CPPCHECK "Enable cppcheck" OFF)
option(USE_CLANG_TIDY "Enable Clang Tidy" OFF)
set(PKGDATADIR "" CACHE STRING "System directory to search for data files")
set(DB_PW "engine" CACHE STRING "The database password")
set(SERVER_PORT "11337" CACHE STRING "Port where the server is listening on")
set(HTTP_SERVER_PORT "8080" CACHE STRING "Port where the http server is listening on")
set(DOCKER_REGISTRY "" CACHE STRING "Docker registry")
option(USE_STACKTRACES "Enable stacktraces" ON)
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(WINDOWS 1)
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Android")

View File

@ -1,2 +1,4 @@
add_subdirectory(template)
add_subdirectory(openworld)
if (GAMES)
add_subdirectory(template)
add_subdirectory(openworld)
endif()

View File

@ -1,6 +1,6 @@
if (CLIENT)
if (OPENWORLD_CLIENT)
add_subdirectory(client)
endif()
if (SERVER)
if (OPENWORLD_SERVER)
add_subdirectory(server)
endif()

View File

@ -23,7 +23,9 @@ if (TOOLS)
else()
message(STATUS "Don't build mapview")
endif()
add_subdirectory(aidebug)
if (AIDEBUG)
add_subdirectory(aidebug)
endif()
else()
message(STATUS "Don't build the tools")
endif()