4 ms·
Is there a problem with cmake? Why are people still inventing new build systems?
by dingo_bat 9y ago
Is there a problem with cmake? Why are people still inventing new build systems?
- cimmanom 9y agoBecause make is awkward and not very developer friendly, and it relies on shell scripting, which is arguably even more awkward, hard to learn, and developer-unfriendly. Also, make is very barebones and "close to the metal". Good modern build systems provide libraries of common tasks so you don't have to reinvent the wheel; they can handle parallelism well; and can fall back on makefiles where needed. They let you get more done in less time.
- izacus 9y agoI think you missed the fact that he's talking about Cmake not make. While Cmake can generate make scripts, it can also create IDE projects and some other outputs like Ninja files.
- flohofwoe 9y agocmake cons (IMHO): - the archaic custom scripting language (that's its main problem) - there are many ways to do the same thing, resulting in each (non-trivial) build script looking different - for the above reason, importing dependencies written by somebody else is non-trivial, and its often better to rewrite the cmake scripts completely - it lacks some 'integration features' found in more modern systems like Rust's cargo: (1) proper dependency/package management (2) run targets (3) switching between build configurations should be easier (not just release/debug, also different build target platforms) cmake pros (also IMHO): - can generate IDE project files (that's what most new build systems completely ignore) - very good cross-compilation support - describing a simple build is reasonably simple - broad support for build tools and IDEs
- ihnorton 9y agoMicrosoft (both vscode and studio) seems to be moving toward ide adaptation — parsing output from other compilers, supporting compilation databases and folder-only (non solution) projects. Perhaps this, combined with Clang viability for MSVC ABI, will reduce the impetus for cross-platform projects to use cmake just to support Windows. Of course, there’s added inertia in favor of cmake due to LLVM, Boost, and others moving over. Not to mention that Microsoft now also supports the “cmake server” concept (there will be some deep irony if after 20 years of “we need cmake to support Microsoft” the argument for the next N years becomes “we should use cmake because Microsoft supports it”).
- dcuthbertson 9y agoAnother disadvantage of cmake, when generating VS solution and project files, is that they are not standalone - just like when it generates makefiles [1]. It makes it nearly impossible to reason about your build dependencies from the VS IDE. [1] https://github.com/qznc/annoying-build-systems#cmake https://github.com/qznc/annoying-build-systems#cmake
- IshKebab 9y agoHave you used CMake?? Remind me again how argument parsing works? How do I know if a variable is a list or not? What's that? Lists are strings? Everything is strings??? CMake is firmly in the "filenames don't contain spaces" era, along with make, Autotools etc. Granted it is more or less the standard at the moment but look at Meson to see how totally insane it is.