Summary
The summary module prints a configuration summary at the end of the CMake configure step. It collects information from all loaded modules and presents it in a compact, aligned format, giving developers an immediate overview of how the project is configured.
The summary is automatically deferred using
cmake_language(DEFER) so that it
always appears last in the configure output, after all modules have registered their options and variables.
Built-in sections
The summary automatically displays the following information when the corresponding modules are loaded:
Project info:
- Preset name — when using CMake presets
- Install prefix
- Project version — when the version module has set it
Build configuration:
- Generator (Ninja, Unix Makefiles, etc.)
- Build type (Debug, Release, RelWithDebInfo, etc.)
- Build docs — when the
BUILD_DOCSoption is defined - Build tests — when the
BUILD_TESTINGoption is defined - Coverage — when both
BUILD_TESTINGandENABLE_COVERAGEare defined
Sanitizers — when the sanitizers module is loaded:
- Undefined, address, memory, and thread sanitizer status
Custom entries
Use add_summary_entry to add project-specific information after the built-in sections. Entries appear in the
order they are registered.
add_summary_entry
add_summary_entry(<label> <value>)
| Parameter | Description |
|---|---|
label | Short name shown in the left column |
value | Value shown in the right column |
find_package(SQLite3)
add_summary_entry("sqlite" "${SQLite3_FOUND}")
Behavior
- Only prints for top-level projects.
- Labels are automatically aligned to the longest entry for readability.
Example output
mylib summary:
preset: release
prefix: /usr/local
version: 1.2.3
generator: Ninja
build type: Release
build docs: OFF
build tests: ON
with coverage: OFF
sanitize undefined: ON
sanitize address: ON
sanitize memory: OFF
sanitize thread: OFF
sqlite: TRUE