4 ms·
CMake might be the best thing we have in C++, but god does that fact tell you what we have to work with. I've never delved far into CMake, but I regularly make
by s9w 6y ago
CMake might be the best thing we have in C++, but god does that fact tell you what we have to work with. I've never delved far into CMake, but I regularly make two observations that make my shy away:
1) Every time some "guide" gets posted on the programming communities, there's people pointing out mistakes, deprecated functions or alternatives.
2) If you look at the CMakeLists.txt files of various popular libraries, they all look different. There's some commonality but much less than what you would desire from a more or less standard build system.
- dgellow 6y agoMaybe what we need is a CMake linter with rules for some strong default opinions.
- benttoothpaste 6y agoWhat we need is CMakeCMake. A special CMake for building CMake rules with its own special meta-language.
- rurban 6y agoThere is a cmake linter. I use it for some of the projects I inherited which still use cmake. But cmake is a joke really. Overly simplistic, but for anything close to a real project compared to autotools, autotools is much much better. With autotools you get tons of constantly improving standard probes and fixes. Cmake is only for really trivially small projects. I just added cross-compilation support for my aarch64 phones. It was doable with cmake, but it's a huge mess. With autotools it would have needed no changes at all. For cmake I need seperate CmakeCFG files. Not even talking about adding GPU support. Or valgrind. Or proper testing.
- lasagnaphil 6y ago1) always comes up in HN and it’s totally hilarious. Seriously I do not know (and do not care) what is the “right” way to write CMake anymore. It’s kinda like C++ where everyone has their own standards for writing code (think of Orthodox C++ vs Modern C++) but the consensus is even more scattered out in the case of CMake.
- formerly_proven 6y ago> CMake might be the best thing we have in C++ CMake is not the best build tool for C++, in a technical sense (pretty much every hash-DAG based tool like Qbs or Bazel is better), but it is the most common tool, which has little to do with merit.
- deleted 6y ago[deleted]