Problem
Developers and CI must specify long -DXTRKCAD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug ... flag strings manually. There is no standard way to share preset configurations across contributors or CI environments.
Solution
Add CMakePresets.json (supported from CMake 3.19, already satisfied by the 3.20 minimum) with:
- configurePresets: debug-linux, debug-macos, debug-windows-vcpkg, release-linux
- buildPresets: inherit each configure preset; set jobs=0 (auto nproc)
- testPresets: output-on-failure; support -R filter
- workflowPresets (cmake >= 3.25): ci-linux, ci-windows combining configure+build+test in one cmake --workflow call
Benefits
- Developers: cmake --preset debug-linux replaces the manual -D flag string
- CI: cmake --workflow --preset ci-linux replaces multiple cmake invocation steps
- Windows: debug-windows-vcpkg preset encodes the vcpkg toolchain path automatically
Note
No MSYS2 presets — Windows target is GTK3 via official runtime + vcpkg only.
Diff: