CMakeLists.txt: provide sane defaults for which subsystems to build

not to have to explicitly disable particular ones in multiple locations.
This commit is contained in:
Alexander A. Klimov 2023-02-23 14:54:57 +01:00
parent d9767cff3f
commit 260eb5c475
4 changed files with 13 additions and 20 deletions

View File

@ -16,21 +16,21 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()
option(ICINGA2_WITH_MYSQL "Build the MySQL IDO module" ON)
option(ICINGA2_WITH_PGSQL "Build the PostgreSQL IDO module" ON)
if(WIN32)
set(ICINGA2_MASTER OFF)
else()
set(ICINGA2_MASTER ON)
endif()
option(ICINGA2_WITH_MYSQL "Build the MySQL IDO module" ${ICINGA2_MASTER})
option(ICINGA2_WITH_PGSQL "Build the PostgreSQL IDO module" ${ICINGA2_MASTER})
option(ICINGA2_WITH_CHECKER "Build the checker module" ON)
option(ICINGA2_WITH_COMPAT "Build the compat module" ON)
option(ICINGA2_WITH_LIVESTATUS "Build the Livestatus module" ON)
option(ICINGA2_WITH_COMPAT "Build the compat module" ${ICINGA2_MASTER})
option(ICINGA2_WITH_LIVESTATUS "Build the Livestatus module" ${ICINGA2_MASTER})
option(ICINGA2_WITH_NOTIFICATION "Build the notification module" ON)
option(ICINGA2_WITH_PERFDATA "Build the perfdata module" ON)
option(ICINGA2_WITH_TESTS "Run unit tests" ON)
# IcingaDB only is supported on modern Linux/Unix master systems
if(NOT WIN32)
option(ICINGA2_WITH_ICINGADB "Build the IcingaDB module" ON)
else()
option(ICINGA2_WITH_ICINGADB "Build the IcingaDB module" OFF)
endif()
option(ICINGA2_WITH_ICINGADB "Build the IcingaDB module" ${ICINGA2_MASTER})
option (USE_SYSTEMD
"Configure icinga as native systemd service instead of a SysV initscript" OFF)

View File

@ -1763,10 +1763,9 @@ mkdir build
cd .\build\
& "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" `
-DBoost_INCLUDE_DIR=C:\local\boost_1_81_0-Win64 `
-DICINGA2_UNITY_BUILD=OFF -DBoost_INCLUDE_DIR=C:\local\boost_1_81_0-Win64 `
-DBISON_EXECUTABLE=C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_bison.exe `
-DFLEX_EXECUTABLE=C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_flex.exe `
-DICINGA2_WITH_MYSQL=OFF -DICINGA2_WITH_PGSQL=OFF -DICINGA2_UNITY_BUILD=OFF ..
-DFLEX_EXECUTABLE=C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_flex.exe ..
& "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe" .\icinga2.sln
```
@ -2045,8 +2044,6 @@ Variable | Value
`BOOST_LIBRARYDIR` | Binary: `C:\local\boost_1_81_0\lib64-msvc-14.2`, Source: `C:\local\boost_1_81_0\stage` | Path to the static compiled Boost libraries, directory must contain `lib`.
`BISON_EXECUTABLE` | `C:\ProgramData\chocolatey\lib\winflexbison\tools\win_bison.exe` | Path to the Bison executable.
`FLEX_EXECUTABLE` | `C:\ProgramData\chocolatey\lib\winflexbison\tools\win_flex.exe` | Path to the Flex executable.
`ICINGA2_WITH_MYSQL` | OFF | Requires extra setup for MySQL if set to `ON`. Not supported for client setups.
`ICINGA2_WITH_PGSQL` | OFF | Requires extra setup for PgSQL if set to `ON`. Not supported for client setups.
`ICINGA2_UNITY_BUILD` | OFF | Disable unity builds for development environments.
Tip: If you have previously opened a terminal, run `refreshenv` to re-read updated PATH variables.

View File

@ -56,8 +56,6 @@ if (Test-Path CMakeCache.txt) {
-DCMAKE_BUILD_TYPE="$env:CMAKE_BUILD_TYPE" `
-G "$env:CMAKE_GENERATOR" -A "$env:CMAKE_GENERATOR_PLATFORM" -DCPACK_GENERATOR=WIX `
-DCMAKE_INSTALL_PREFIX="$env:ICINGA2_INSTALLPATH" `
-DICINGA2_WITH_MYSQL=OFF -DICINGA2_WITH_PGSQL=OFF `
-DICINGA2_WITH_LIVESTATUS=OFF -DICINGA2_WITH_COMPAT=OFF `
-DOPENSSL_ROOT_DIR="$env:OPENSSL_ROOT_DIR" `
-DBOOST_LIBRARYDIR="$env:BOOST_LIBRARYDIR" `
-DBOOST_INCLUDEDIR="$env:BOOST_ROOT" `

View File

@ -59,8 +59,6 @@ if (Test-Path CMakeCache.txt) {
& cmake.exe "$sourcePath" `
-DCMAKE_BUILD_TYPE="$env:CMAKE_BUILD_TYPE" `
-G "$env:CMAKE_GENERATOR" -A "$env:CMAKE_GENERATOR_PLATFORM" -DCPACK_GENERATOR=WIX `
-DICINGA2_WITH_MYSQL=OFF -DICINGA2_WITH_PGSQL=OFF `
-DICINGA2_WITH_LIVESTATUS=OFF -DICINGA2_WITH_COMPAT=OFF `
-DOPENSSL_ROOT_DIR="$env:OPENSSL_ROOT_DIR" `
-DBOOST_LIBRARYDIR="$env:BOOST_LIBRARYDIR" `
-DBOOST_INCLUDEDIR="$env:BOOST_ROOT" `