3 ms·
I agree that CMake is better than handwriting a Makefile, it is still absolutely shit compared to Rust's build system or the straightforwardness of sourcing ext
by chairmanwow 10y ago
I agree that CMake is better than handwriting a Makefile, it is still absolutely shit compared to Rust's build system or the straightforwardness of sourcing external dependencies with Maven or Gradle in Java.
If I want to use an external library in a C++ project, I need to:
* download it from the website / GitHub
* build it from source
* add the library into my CMake file.
Whereas in Gradle, I add a single line to one file and the library is installed on my next build attempt. Full stop. There are no more steps.
C++ makes it searingly painful to get a project going. I'm honestly afraid to add any new libraries to my projects because I know that (at minimum) that means I'm sacrificing an afternoon to resolving new errors.
- btschaegg 10y agoAlthough I generally agree with you (CMake is a pain), I wouldn't say that this problem is caused by the language itself. That you have to compile anything yourself is a byproduct of the fact that different platforms have different ABIs, combined with the lack of proper package management on platforms like Windows. What I find the most enervating about CMake is that somehow everyone agreed (at least to some degree) to use the worst cross-platform build tool in existence. Instead of a build system based on solid principles we got a "hack your own build" starter kit in which you have to look for dependencies yourself ^1 combined with a build script language that is worse than the languages it set out to replace. How can anyone honestly be happy when switching from makefiles to this monstrosity? ^1 And no, the FindX scripts never work properly everywhere.
- Arizhel 10y agoPersonally, I agree about CMake and its horrible scripting language, and I like Scons a lot more. It's Python-based so it's easy to work with and flexible, and not nearly as ugly as CMake.
- sqeaky 10y agoI think CMake took off, because it has no dependencies, works with any IDE and can be extended to do anything. I have been in places where demanding python just wouldn't work. Either a specific version was needed for something else and managing the dependencies was a pain or we were already reliant on other scripting languages. I think this kills any other language as a build tool. There are zealots for every IDE and some IDEs require special project files. If your build system doesn't seamlessly integrate most then it couldn't have made it. Scons never worked with IDEs I liked, Know how to get it cowkring with QtCreator? Other will demand vs2015r3 integration, how do you do that? Then then there are the build systems you didn't mention, but the minimalistic ones. There was even one that was entirely stateless, but it was also too inflexible for most real builds. CMake very carefully walked a thin line that dodged all these issues and the fact it is a giant pile of global mutable shared state simply doesn't for all but the largest builds.
- gerbilly 10y ago>I agree that CMake is better than handwriting a Makefile Really? I feel the opposite. At least when I write makefiles by hand I understand them fully. Cmake just confuses me, I'm not sure it's such and improvement.