Using CMake Presets to Standardize Configure and Build Invocations
Learn how to commit CMakePresets.json for reproducible builds while keeping user‑specific settings separate, with a worked example and verification steps.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to commit CMakePresets.json for reproducible builds while keeping user‑specific settings separate, with a worked example and verification steps.
Adopt CMake’s FetchContent to embed external libraries directly into your build tree—no pre‑installed packages, simplified CI, and automatic transitive linking. This guide covers the minimal design, trust boundaries, operational checks, failure modes, and when to pivot to another strategy.
Modern CMake’s target‑based API replaces global include/definition commands with per‑target visibility keywords (PUBLIC/PRIVATE/INTERFACE). Learn how to propagate compile options correctly, avoid legacy pitfalls, and verify propagation with a concrete example.
Learn how to use Dune's explicit module and library stanzas to eliminate implicit dependencies and ensure reproducible, sandboxed OCaml builds.
Use CMake INTERFACE libraries to cleanly propagate include paths, compile definitions, and compiler options across a build tree without generating a binary. This guide shows the minimal design, operational checks, and when to switch strategies.
When a build compiles but the linker reports undefined references, the culprit is often a mis‑configured link scope or a missing INTERFACE library. This guide walks through the most common causes, step‑by‑step checks, and concrete fixes for CMake 3.11+.
A practical guide to using Dune's wrapped libraries, .mli sealing, and inline tests to share code between executables and test suites while keeping production binaries lean.
Learn how to declare, download, and link an external CMake project using FetchContent, with steps for configuration, verification, and handling network or version issues.
CMakePresets.json moves configure, build, and test flags out of brittle shell scripts into a version-controlled file shared by local development and CI.