-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration options
David K edited this page Jan 12, 2024
·
9 revisions
Name, version and description of the project are configured in vcpkg.json.
Due to the limitations of vcpkg, the name can only contain lowercase letters and dashes, the dashes(-) are converted to underscores (_) for use in cmake.
Several CMake presets are provided as well.
The common cmake options are centralized in the cmake/options.cmake file. For more detailed configuration see other files in the cmake directory.
This is a list of all available options and their defaults
- Target names
-
EXE_NAME- Description: name of the compiled executable.
- Default: same as project name.
-
OBJLIB_NAME- Description: name of the object "library". This is a cmake mechanism which allows object files to be shared between the main executable and the tests.
- Default:
EXE_NAME_objlib.
-
TEST_NAME- Description: name of the test executable.
- Default:
EXE_NAME_test.
-
DOXYGEN_SUFFIX- Description: name of the target which builds documentation.
- Default:
EXE_NAME_docs.
-
- Main file
-
MAIN- Description: the file containing the
mainfunction. This file will not be included in the test executable (because it provides its ownmain) so functions/classes defined in it cannot be tested. - Default:
./src/main.cpp.
- Description: the file containing the
-
- Compiled binary location
-
CMAKE_ARCHIVE_OUTPUT_DIRECTORY- Description: compiled archive (
.a/.lib) output directory. - Default:
build/lib
- Description: compiled archive (
-
CMAKE_LIBRARY_OUTPUT_DIRECTORY- Description: compiled library (
.so/.dll) output directory. - Default:
build/lib
- Description: compiled library (
-
CMAKE_RUNTIME_OUTPUT_DIRECTORY- Description: compiled executable (' '/
.exe) output directory. - Default:
build/bin
- Description: compiled executable (' '/
-
- Testing (see testing)
-
BUILD_TESTING- Description: should the tests be built
- Default:
ON.
-
- Analyzers (see analyzers)
-
ENABLE_CPPCHECK- Default:
OFF
- Default:
-
ENABLE_CLANG_TIDY- Default:
OFF
- Default:
-
ENABLE_INCLUDE_WHAT_YOU_USE- Default:
OFF
- Default:
-
- Sanitizers (see sanitizers)
-
ENABLE_SANITIZERS- Default:
OFF
- Default:
-
SANITIZER_LIST- Default:
address,leak,undefined
- Default:
-
- Documentation (See documentation)
-
ENABLE_DOXYGEN- Default:
OFF
- Default:
-
- Warnings
-
WARNINGS_AS_ERRORS- Description: Treat all warnings as errors
- Default:
ON
-
- Caching
-
ENABLE_CACHE- Description: Use ccache to cache compiled object files
- Default:
OFF
-
CACHE_PROGRAM- Description: Name of the caching program
- Default:
ccache
-
- Language
-
CMAKE_CXX_STANDARD- Description: Standard of the language to use
- Default:
17
-
CMAKE_CXX_EXTENSIONS- Description: Whether to allow compiler specific language extensions
- Default:
OFF
-
- Compile commands
-
CMAKE_EXPORT_COMPILE_COMMANDS- Description: Enable generation of
compile_commands.jsonused by various clang based tools. - Default:
OFF
- Description: Enable generation of
-