Hacker News new | ask | show | jobs
by wootoomoo 3798 days ago
I'm pretty baffled that people recommend CMake so often. I looked into it, and found:

* The worst scripting language ever, seemingly made by someone without even basic theoretical knowledge of language parsing. It's even worse than shell scripting.

* The same I-don't-care copypasta culture most autotools users seem to follow, but the free documentation was even worse (or at least back when I tried it). There's a book which I didn't have access to, though.

* Less enduser/packager friendly, with worse help texts, documentation, and features (seems to have caught up somewhat). Plus, everybody already knows how configure scripts work.

* The portability to Windows in reality means lots of if(WIN32) branches.

* The results are often brittle. This is also true of autotools in practice, but at least there is some info out there about how to write autoconf macros correctly. Even the .cmake files that ship with CMake seemed to be thrown together carelessly the last time I looked.

* Also, CMakeLists.txt must be the worst filename for a script I've ever seen. I'm only half serious on that one. I know it doesn't matter, but it bothers me terribly. It's ugly and misleading and makes me question the author's sense of aesthetics and basic competence.

CMake is terrible. Autotools is also terrible, but at least it's got an excuse. Just learn your damn tools. The real problem with autoconf is that nobody wants to invest any time learning about their build system and instead just copy-pastes it around, creating a brittle mess. From the CMake projects I've seen, it doesn't really solve this problem at all, creating a similar mess. And now your users have to install CMake and figure out how it works, and it doesn't even print a useful --help text.

2 comments

Appreciate your opinion. Have been looking into CMake this evening, and my little impression was that it does not make the problem smaller, just different. The things I have been searching for, also did not yield that much high quality answers. Think I will stick to learn autotools enough, as that might come in more handy in general.
Managing seperate build files for each platform sucks, especially on big projects. Thats where CMake is useful to me. It simplifies a lot for our company, but to each his own.

Agree that CMakeLists.txt is a terrible build script name though haha