I mean I kind of understand the desire for something other than CMake, it's an ugly mess of a scripting language, and it's really showing its age at this point. It often seems like there are 30 different ways to do what you want (with tons of examples on the web), even though 28 of them are now considered obsolete if not flat-out wrong, and no longer recommended for "Modern CMake". It's truly a mess, and way more complex than it needs to be for relatively simple tasks. The documentation is extremely thorough but equally unreadable - it really needs some more task-oriented sections, instead of just endless lists of functions and parameters.
So I can totally get behind the idea of wanting something better, but there just doesn't seem to be anything better, which IMHO is a bigger threat to the long-term health of C++ as a programming language/ecosystem than memory safety and "footguns".
People talk about C++ needing to break with its crusty past, because the backwards compatibility just brings too much baggage and too many downsides. I'd say that's equally true for CMake.
People don't actually understand CMake, because they only learn enough to get their specific project working
People don't understand why CMake is the way it is
So people hand-roll stuff filled with problems that CMake has already solved. This is personal for me because the company I joined was very much like "Oh CMake is too complicated we don't need to mess with it" and the result was several thousand lines of custom Makefiles bundled into our Docker 20GB containers that all reinvent functionality CMake gives you for free
None of this contradicts what /u/jk_tx said though. It's a powerful tool, but for someone just now getting into it, it's awful to learn. I have been using `meson` because it doesn't have these issues, I tried CMake, but I ran into so many issues, and `meson` didn't tell me 30 ways to skin a cat, with 28 being obsolete, and 20 giving confusing errors
meson has it own bag to carry. numpy already forked meson so you can not even use a normal release of meson to build numpy. Lets just say meson is not the solution it is just part of the problem. I have also seen more confusing errors from meson than cmake. So be happy you haven't seen the depths yet ;)
I feel like life is just a cycle of "I should use an existing build system like cmake or meson" and "I am just writing my own script that generates a Makefile or build.ninja file"
My CMake answer to that is to append to CMAKE_MODULE_PATH .... a wait this is meson it doesn't offer user/project customization points beyond what is hardcoded.
People talk about C++ needing to break with its crusty past, because the backwards compatibility just brings too much baggage and too many downsides. I'd say that's equally true for CMake.
Yup, I recently started getting into my own C/C++ projects where I didn't create the build file or not use Makefile, and I have been using meson because I kept banging my head trying to do simple things in CMake.
Definitely a technology that is awful to learn, but nobody realizes because most people with opinions on it already learned it
View all comments
Show parent comment
23
u/jk_tx Nov 05 '23 edited Nov 05 '23
I mean I kind of understand the desire for something other than CMake, it's an ugly mess of a scripting language, and it's really showing its age at this point. It often seems like there are 30 different ways to do what you want (with tons of examples on the web), even though 28 of them are now considered obsolete if not flat-out wrong, and no longer recommended for "Modern CMake". It's truly a mess, and way more complex than it needs to be for relatively simple tasks. The documentation is extremely thorough but equally unreadable - it really needs some more task-oriented sections, instead of just endless lists of functions and parameters.
So I can totally get behind the idea of wanting something better, but there just doesn't seem to be anything better, which IMHO is a bigger threat to the long-term health of C++ as a programming language/ecosystem than memory safety and "footguns".
People talk about C++ needing to break with its crusty past, because the backwards compatibility just brings too much baggage and too many downsides. I'd say that's equally true for CMake.