Overview#
clibra wraps cmake, cmake --build, and ctest with
preset-aware defaults. Every command it runs is visible and reproducible
without the CLI — see The escape hatch.
How It Works#
Each clibra subcommand maps to one or more cmake / ctest
invocations. For example:
clibra build --preset debug
# is exactly:
cmake --preset debug # only on cold start
cmake --build --preset debug -j$(nproc)
clibra test --preset debug
# is exactly:
cmake --build --preset debug --target all-tests
ctest --preset debug
clibra ci --preset ci
# preferred (if workflow preset exists):
cmake --workflow --preset ci
# fallback (if no workflow preset):
cmake --build --preset ci --target all-tests
ctest --preset ci
cmake --build --preset ci --target gcovr-check
Before running, each subcommand:
Verifies
CMakeLists.txtexists in the current directory.Resolves a preset name — see Preset resolution.
Checks that the preset’s CMake cache has the required
LIBRA_*flags enabled (e.g.LIBRA_TESTS=ONforclibra test).Checks that the required CMake targets exist.
Steps 3 and 4 are skipped when --dry-run is given.
Global Flags#
These flags are accepted by every subcommand.
- --preset <NAME>#
CMake preset name to use. When absent,
clibraresolves a preset automatically — see Preset resolution for the full resolution order.
- --dry-run#
Print the
cmake/ctestcommands that would be run, then exit without executing them. Target availability checks and filesystem checks are skipped. Useful for verifying what a command will do before running it:clibra build --preset debug --dry-run # prints: cmake --preset debug # cmake --build --preset debug --parallel 8
- --log <LEVEL>#
Log verbosity. Controls
clibra’s own diagnostic output, not CMake’s.Values:
error|warn(default) |info|debug|traceFor more CMake output, use
--log infoor--log debug. For per-command cmake verbosity, pass-DCMAKE_VERBOSE_MAKEFILE=ONvia-D.
- --color <MODE>#
ANSI color output control.
Values:
auto(default) |always|neverautoenables color when stdout is a TTY. Usealwaysto force color through a pager, orneverto disable it entirely.
The escape hatch#
clibra never introduces state that CMake cannot read. The only files
it ever writes are CMakePresets.json and CMakeUserPresets.json,
and only on explicit request. You can stop using clibra at any point
and drive the build with plain cmake / ctest — no cleanup
required.
To see the exact commands clibra would run for any operation, use
--dry-run.