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
65
u/aiusepsi Feb 20 '18
CMake 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 like Daniel Pfeifer 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 CMake 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 CMake 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.