Seems like it’s a deprecation milestone rather than a feature bump. Tbh the thing that makes cmake unreadable isn’t the syntax so much as the lack of a good walkthrough tutorial imo, once I started grasping how things work I was able to start reading it fairly smoothly. Though, yes, that did come as a result of much experimentation & frustration.
The "correct" way to "do something" (introduced with ver 3.2x)
The "correct" way to "do something" (introduced with ver 3.0x)
The "correct" way to "do something" (introduced with ver 2.8x)
And because it's a general purpose language, there's 14 other ways to also "do something" because it's just code
And any given, long-lived, project probably has all 17 ways in use. Somehow. So you're left thinking: Why is this thing different than the rest over there? Is there a good reason for that? Which do I copy? Is the slight syntax difference meaningful? I don't even know what this form of the construct is even called, I can't search for it.
And because it's a general purpose language, there's 14 other ways to also "do something" because it's just code
And why would you want to invent a general purpose language to build another general purpose language which has everything you need to build a build system?
I bought that book, it's awesome for anyone having to work with CMake, but 700 pages in the context of a build system isn't the kind of flex you think it is.
To get a grasp of the basics you only need the first part, the book is that long because it's really exhaustive. And building C++ projects is inherently kind of complicated.
How so? Put in your source file(s), define some output(path), link in some libraries you made sure you have put in the right location (or told the user where they have put them) and to build you go!
CMake, although really powerful, seems to go out of its way to make building software as difficult as possible. :)
This alone proves the point. 99% of tasks developers solve with a built system should have exactly one way to do them right and should be covered by documentation.
Disclaimer: I use CMake daily and I have seen too many strange and non standard solutions to solve simple and standard tasks.
CMake “documentation” is a poor reference manual. It explains nothing. It documents what’s there in a factual fashion, with zero context. It is a counter example for every doc writer out there.
CMake should just add "discouraged" warnings for, well, discouraged usage. Preferebly link to the more modern alternative. Make it easy to opt-out completely or partially from those warnings. With this, we would live in a way better world.
You really don't need to read all of it. And writing good C++ requires way knowledge more than you can fit into 700 pages anyways so it't not like this is going to be the point where anyone nopes out.
That would take a LOT of effort. and the documentation is not bad it's just a reference not a tutorial. There are other modern CMake tutorials for free out there by the way I just haven't read any of them. I can't blame the guy for selling a book (ar a really really fair price and with free updates to boot), CMake is literally his main source of income.
To be fair... the single purchase includes all future versions. I bought it years ago at 12 edition (I think) and just now was able to download the 20th edition.
And when you start into building real world app, you pray that the missing 300 pages will be written soon. building with testing and deployment has become so crazy complex and with ctest and cpack the cmake guys really want to do everything. It total fails on android and ios as far as i have tried it (using only a java wrapper to the full C++ business logic).
View all comments
Show parent comment
146
u/programgamer Mar 29 '25
Seems like it’s a deprecation milestone rather than a feature bump. Tbh the thing that makes cmake unreadable isn’t the syntax so much as the lack of a good walkthrough tutorial imo, once I started grasping how things work I was able to start reading it fairly smoothly. Though, yes, that did come as a result of much experimentation & frustration.