t4mer@notebook

// til · cmake · 7 august 2026 · 1 min

TIL: what CMake actually does

CMake does not compile your program. It generates the build that compiles your program.

I kept treating CMakeLists.txt as if it were Composer: a list of dependencies, run it, get an application.

CMake is a build system generator. You describe targets and files. CMake produces something a real build tool can run - Ninja, Visual Studio, Make - which then compiles and links.

That is why “I have CMake” and “this kit can compile this project” are different sentences. That is why a project can configure and still fail to build. That is why the file looks like a programming language having an argument with your operating system.

I do not need to become a CMake expert to ship a hello world. I do need to stop expecting cmake . to be composer install.

Found something wrong?

These notes can be incomplete, or wrong in a different environment. Suggest a correction on GitHub or email me at me@t4mer.net.

// related