CMake — From Basics to Building
summary
CMake 3+ usage principles with actionable rules: explains the distinct configure vs generate phases so configuration logic never depends on build-time choices; shows how to prefer interface/imported targets over global variables and link-directories and why that fixes transitive includes and rebuilds; demonstrates using generator expressions (Genex) to get per-configuration flags while keeping multiconfig generators like Visual Studio and Ninja working; warns against globbing sources and deprecated compile_flags and recommends cache variables for user-configurable defaults.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:53What CMake is
- 8:40Configure and generate phases
- 15:45Targets libraries executables
- 21:29Target configuration requirements
- 26:46Interface libraries
- 29:17External dependencies
- 34:37Project settings properties
- 39:16Generator expressions
- 45:42Modern CMake practices
- 51:25Cache variables
- 56:25Key takeaways and Q&A
related talks
55mCMake for the impatient
05mLightning Talk: What Does a CMake Developer Want From CMake?
49mBuild Systems: a Simple Solution to a Complicated Problem
58mThere Will Be Build Systems: I Configure Your Milkshake
01h 06mCommand Line C++ Development
59mTips and Tricks for Becoming a CMake Master
01h 00mCross-Platform Pitfalls and How to Avoid Them
58mLevel Up Your Debugging Workflow with CMake Presets, Disassembly View, & GitHub Actions
