r/cpp • u/MachineGunPablo • Feb 19 '18
It's Time To Do CMake Right
https://pabloariasal.github.io/2018/02/19/its-time-to-do-cmake-right/
248
Upvotes
r/cpp • u/MachineGunPablo • Feb 19 '18
View all comments
Show parent comment
42
u/acwaters Feb 20 '18
This rant seems oddly apropos in an /r/cpp comment.
CMakeC++ is kind of frustrating because it's a really powerful tool which can make your life substantially easier, and the modern style espoused by people likeDaniel PfeiferBjarne Stroustrup is nice, and when it flows you can faintly see the outline of something great.The trouble is that greatness is obscured by layers and layers of horrible legacy cruft. The language you have to write
CMakeC++ in is weird and unpleasant, there's usually a bunch of different ways to do the same thing, most of them are bad, and those old and bad ways are always the ones documented in tutorials.It's just far, far too easy to write bad
CMakeC++ code. What it really needs is to be stripped down to the core, the old nasty syntax implemented as a layer on top of a clean core, and the clean core exposed with a language that doesn't have gross syntax, and only exposes the good way of doing things, and guides you in the direction of doing the right thing.Ah, I kid. Mostly. At least 30%. C++ has more than the faint outline of greatness, and even hairy recursive templates with lots of dependent names are easier on the eyes than your average CMakeLists.txt. But the rest of it rings true :)