cmkr: declarative CMake generation for cleaner C++ builds
Experience a declarative build flow by writing a single cmake.toml to produce standard CMake projects, including targets and dependencieswords). Duncan Ogilvie created cmkr as a utilities-tool to wrap CMake with a Cargo-like TOML manifest, preserving CMake compatibility while reducing boilerplatewords). Key capabilities include TOML configuration, automatic CMakeLists.txt generation, FetchContent and vcpkg integration, and self-bootstrapping for CI; developers who want less manual CMake scripting get the most benefitwords).
What does cmkr do in practical terms?
cmkr reads a human-readable cmake.toml file and generates idiomatic CMakeLists.txt files automatically. The tool accepts project metadata, multiple target definitions (executables, static and shared libraries), conditional logic, and platform-specific options in TOML, then emits standard CMake that any CMake-aware IDE or build step can consume. This replaces hand-written CMake scripts with a single declarative manifest for each project.
How does it behave in CI and shared projects?
cmkr offers self-bootstrapping, so a repository can include the generated files and a bootstrap script that lets downstream builders run with only standard CMake and a C++ compiler. That design means CI pipelines don't need cmkr preinstalled; the generated CMake remains the canonical input for automated builds, making project sharing and integration with existing CI workflows straightforward.
Is cmkr safe and how steep is the learning curve?
The tool preserves CMake compatibility by producing standard CMakeLists.txt, so it does not replace CMake at build time. Conditional logic and platform-specific rules live in TOML, which requires learning cmkr's mapping from declarative entries to CMake constructs. The developer's background with C++ tooling and prior experience with CMake will reduce the ramp-up time; beginners benefit from less verbose configuration but must learn the manifest schema.
Clear choice for C++ teams that want declarative build metadata
cmkr suits developers who prefer writing a single TOML manifest instead of maintaining multiple CMake scripts; it keeps projects compatible with existing CMake tooling and IDEs while making repository bootstrapping possible. The primary trade-off is the extra layer of abstraction: teams must map CMake concepts into the declarative schema, which adds an initial learning step before the time savings appear.





