An Introduction to CMakePresets.json
summary
CMakePresets.json arrives in CMake 3.19/3.20 and provides repository-checkin cmakepresets.json plus per-user cmakeuserpresets.json to replace ad hoc shell/batch scripts for configure build and test. Configure presets (3.19) and build/test presets (3.20) set generator (Ninja, VS, Xcode), cache variables, inheritance, targets and parallelism; CLI, CMake GUI, VS Code (CMake Tools v1.7) and Visual Studio (16.10 preview) integrations demo successfully, with vendor map entries for IDE-only options and a noted Visual Studio caveat around multi-config generators.
AI-written summary · about
chapters (12)
- 0:00Introduction to presets
- 0:23What are CMake presets
- 0:54Presets vs other methods
- 2:34Benefits of using presets
- 3:46Configure presets example
- 5:33Build and test presets
- 6:28IDE integration and vendors
- 8:12Command line demo
- 12:00VS Code and GUI demo
- 14:37Visual Studio and WSL demo
- 16:53Resources for learning
- 17:49Q&A and conclusion
related talks
58mLevel Up Your Debugging Workflow with CMake Presets, Disassembly View, & GitHub Actions
01h 04mCMake and Conan: past, present and future
54mCMake for the Impatient
01h 01mGit, CMake, Conan - How to ship and reuse our C++ projects
04mDev Containers in Visual Studio
01h 01mClean CMake for C++ (library) developers
01h 00mHow to start a modern C++ project
46mBuilding and Packaging Modern C++
