Things I Learnt While Trying to Avoid Becoming a CMake Expert
summary
Maintains several widely used CMake modules and shows concrete patterns: using ninja for fast incremental builds, preferring out-of-source builds, and generating files with configure_file to create a small library_info module that compiles and links correctly. Demonstrates tradeoffs between configure-time vs build-time code generation, target_link_libraries propagating include paths via PUBLIC, and gotchas with cache variables persist across runs (delete the build dir to reset). Includes demos that build an executable and static library successfully.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 1:36Welcome
- 3:06What is CMake
- 8:56Why use CMake
- 15:21Configuration
- 16:21Build
- 20:18CMake List
- 23:04Demo
- 32:05Naming Targets
- 38:39Target Link Libraries
- 43:17Demo Time Linking
- 44:30Linking Errors
- 46:50Rerun the Build
- 49:18Target Include Directory
- 49:58Generated Print
- 52:51Types of Variables
- 53:12Regular Variables
- 54:13Dynamic Scopes
- 54:42Cache Scopes
- 55:19Environment Variables
- 59:01Cache Bad Values
related talks
54mCMake for the Impatient
49mBuild Systems: a Simple Solution to a Complicated Problem
58m“Using Modern CMake Patterns to Enforce a Good Modular Design”
01h 26mOur Other C++ Interfaces
01h 01mGit, CMake, Conan - How to ship and reuse our C++ projects
01h 18mIntegrating C++ Code Generation Into a Large CMake Build
01h 14mBuilding and Organising a Multi-Platform Development Code Base
26mC++ Modules Myth Busting
