CMake Purpose Guide agents through modern (target-first) CMake for C/C++ projects: out-of-source builds, dependency management, generator selection, and integration with CI and IDEs. Triggers - "How do I write a CMakeLists.txt for my project?" - "How do I add an external library with CMake?" - "CMake can't find my package / library" - "How do I enable sanitizers in CMake?" - "How do I cross-compile with CMake?" - "How do I use CMake Presets?" Workflow 1. Modern CMake principles - Define targets, not variables. Use commands. - Use / / to control property propagation. - Never use or (legacy). -…