4 ms·
Any examples of pain points with CMake? I use it every day and rarely have issues, yet I seem to see complaints online rather often.
by jonpalmisc 4y ago
Any examples of pain points with CMake? I use it every day and rarely have issues, yet I seem to see complaints online rather often.
- b_m_x 4y agoeasy, CMake 3.xx or higher is required.
- jonpalmisc 4y agoSo… a build of CMake from within the last 8 years? Seems like a reasonable requirement.
- jamesfinlayson 4y agoI haven't tried CMake recently but I remember using it in 2012 and it was awful - the documentation was unhelpful and as soon as I tried to do anything not in the examples I was on my own.
- Teknoman117 4y agoI'd love to hear why you think that's a bad thing. IMHO it's a huge quality of life improvement over 2.x. Everything is part of a target (flags, defines, dependencies, etc.) and far, far fewer magic variables that pollute random projects whenever you try to compose them.
- 0x20cowboy 4y agoCmake is confusing as all get out. Make follows the Unix philosophy of just doing one thing - call other programs. It comes with almost all tool chains you’d care about. You can pick up the basics of a makefile in an afternoon… I still don’t know where cmake functions come from, how you would know about them or how to write your own. Let alone which version is the right one. It’s like jsonnet to me - if you need config files that make config files something has gone horribly wrong. Then again, I stopped bothering trying to learn Cmake. If I see Cmake I don’t bother with the project so there’s that - and also not a fan of c++ so I am probably the wrong audience anyway.
- self_awareness 4y agoWhat is confusing about CMake? cmake_minimum_required(VERSION 3.5) add_executable(exe file.cpp) Do you think that's more complicated than the basics of a Makefile? [1] [1]: https://anadoxin.org/blog/is-it-worth-using-make.html/ https://anadoxin.org/blog/is-it-worth-using-make.html/
- amag 4y agoThere are very few projects for which the above CMakeLists.txt would be enough. Once your project reaches a certain size you will inevitably end up in a part of CMake that is confusing.
- self_awareness 4y agoWell, first argument is that it actually IS enough for lots of small tools, and second argument is that if it's not enough and must be extended, it still requires much less complication than an equivalent Makefile.
- ori_b 4y agoThe comparable makefile: exe: file.cpp Default rules take care of the rest. And if you argue that the barebones example is insufficient for a real project: absolutely true. The same applies to your cmake example.
- self_awareness 4y agoWhat do you mean it's comparable? Does it support multiple compilers? CFLAGS? Out of source builds? "compile_commands.json" generation? Automatic header dependency monitoring? Also I've actually checked that Makefile, and it errored out (macOS): make: Nothing to be done for `exe'.
- ori_b 4y agoHere's what you get for free: https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html#Catalogue-of-Rules https://www.gnu.org/software/make/manual/html_node/Catalogue... As you can see, it takes flags and compiler from the environment.
- nspattak 4y agoif you rarely have issues, either someone else dealt with them before you knew it, either your project is very simple, either your project doesn't ever change or all of the above. I would like to work with your devops :)