Hacker News new | past | comments | ask | show | jobs | submit login

> CMake being the standard

Maybe for windows, but I haven't seen it be that popular in the linux world?




CMake is widely used even on Linux. I wouldn't call it a "standard", and there are many things about it that are unaesthetic, but it has some of the largest market share among C++ build systems. Most software doesn't swap out build systems, so market share is backward-looking and changes based on what new projects use.

I tend to use Meson for C++ because it is much more pleasant to use. Meson is definitely a minority build system, owing in some part to being new-ish, but I see it being used in new projects so it is still growing.


Having spent several years on Bazel and CMake, and only playing around with meson in the last week or so, meson is much more user friendly and easy to get started with.

And by playing around, I mean that I now have a non-trivial project (c. 50,000 loc, 20 libs/apps) that can compile with all three build systems. Then again, I'm a fan of 'keep it simple' in the first place, so I don't tend to do 'stupid' things in my build systems that makes it difficult to port.


I made myself learn modern cmake after using archaic cmake and programming hundreds of lines of cmake functions. Aren't the variable scope semantics kind of fun in an admittedly sadomasochistic way? I'm not particularly competent and I had no problem grossing myself out. I programmed things in cmake that made my ancient advanced perl look like go. However it does all work and your own invented cmake build system is certainly not the most gruesome out there, and there is a lot out there.

Then I tried meson for my own projects, after deciding that cmake was just too ugly and aesthetics matter, to me. For about 3 months I fought the carefully thought out constraints but still liked it. After that the meson design clicked and boy howdy the amount of mental energy I put into my build systems has gone down comfortably close to zero. I adore meson.

Ah I should mention that five years ago or more even I bumped into rough patches in meson but I can say zero in the last few years. Bugs get fixed.

I don't think it implausible though that cmake seems to be getting better for the projects I dive deep into, in an almost meson way. Maybe the days of a project ~/cmake directory containing tens of files and 1000s of lines of bespoke cmake code are dwindling.

Now that I've drunk the meson koolaid, especially about the syntax not being a full programming language, something natively supporting lua, like xmake seems to, makes me wary.


I could envisage cmake evolving towards meson by cleaning up it's complete weird syntax, but it suffers a little bit from something like Conway's Law: it's as convoluted as C++ because it deals with C++, and Hyrum's Law: again, because of C++, it has weird edge cases that people already depend on so it has to be backwards compatible for a long time.

I guess I'm saying cmake is the "build" system you'd expect for C++.

> After that the meson design clicked and boy howdy the amount of mental energy I put into my build systems has gone down comfortably close to zero. I adore meson.

I'm only a week or so into it, and it's been ridiculously easy to get along with so far.


The reason might be that cmake is one of the very few meta build systems that properly support Windows and MSVC (but also macOS and Xcode, compared to all that UNIX+GCC is easy-mode). One underappreciated feature of cmake is that it finds the installed Visual Studio toolchains and Windows SDKs without having to run from a "Visual Studio Developer Command Prompt".



Sadly, another example of the C++ community zigging when it should have zagged.

Cmake now has tooling in all the major IDEs, whereas the other build systems generally don't. Meson and Bazel are build models in CLion but they're relatively new. CMake is the leader at the moment, due to first mover advantage.


I've never built C++ code for Windows, and I still am quite familiar with CMake.

CMake is dominating across all platforms, sadly


I’ve used it to build a lot of projects on Linux. Particularly large and complex opensource projects with a lot of dependencies.


It’s used to build the external dependencies for Hercules (the mainframe emulator) but I personally consider it a humongous pain. It might be the reason no Linux distribution seems to dare to package Hercules 4.x




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: