Chapter 2: The CMake Language

Writing in the CMake Language is a bit tricky. When you read a CMake listfile for the first time, you may be under the impression that the language in it is so simple that it doesn't require any special training or preparation. What follows is very often a practical attempt to introduce changes and experiment with the code without a thorough understanding of how it works. We programmers are usually very busy and are overly keen to tackle any build-related issues with little investment. We tend to make gut-based changes hoping they just might do the trick. This approach to solving technical problems is called voodoo programming.

The CMake Language appears simple: after we have completed our small addition, fix, ...

Get Modern CMake for C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.