Hacker News new | ask | show | jobs
by bodhiandphysics 1205 days ago
I disagree… cmake is very clear about what problem it’s trying to solve… build portability. If you need something to build on windows Mac and a variety of unixen cmake works much better than make. The trouble is that a ) you probably don’t need that and b) cmake is contagious. Soon every library and its grandmother demands cmake. Cmake is also less orthogonal than make is…. Make is endlessly customizable to your work flow. Cmake is too opinionated.
3 comments

Well I see a lot of people that doesn't write that portable CMake anyway, like they use compiler options specific for GCC.
That's because CMake's design and practical realities discourage portability, despite what the docs say. Almost any nontrivial project will need the non-portable target_add_*() calls eventually, so you may as well use them from the start and implement an (almost inherently faulty) compiler/platform switch if you want to target multiple, say to set sane optimization levels.
CMake don't have constructions like "I don't know which C++ compiler is selected, but turn on all warnings for it" and such. So, you need to write compiler-specific options by hands. Many people knows only gcc and/or clang.

CMake declare that it shields developer from knowing nuances of build systems and toolchains, but does it very badly.

Why would I not need/want my builds to work on all platforms if there's nothing platform specific in the code?
I've had to use CMake in a bunch of work projects, but never have I needed them to be portable. They've always been targeted only at Linux. CMake's biggest claimed feature is one that, to me, is utterly useless: I don't care about building on Mac or Windows.
Me neither.. but cmake is infectious. You end up using it because you need libraries that use it