1. 22
    1. 7

      Is anyone still adopting CMake since Meson exists?

      1. 2

        CMake is still in wide use in the field and I can personally say I’ve seen it adopted on a bunch of new projects.

      2. 1

        I had never heard of Meson, but in checking it out, it seems to have existed since 2011. Might I suggest a marketing campaign? What advantages does Meson have over CMake? Why are there two commands, meson and ninja? Is meson opinionated (it seems to be) or flexible?

    2. 4

      This looks like a great kick start guide.

      Would also be great to see (although this is a different thing) a guide for folks inheriting a legacy CMake codebase, because I dealt with that at my last job and it made my head explode.

    3. 4

      I’ve heard that CMake makes complicated builds more easy to manage, but this particular tutorial doesn’t really show that. In fact, it’s actually much less “work” to write a simple Makefile in this case. As such, I left the tutorial with no reason to care about CMake, and instead of a “woah! you knocked my socks off!”, my reaction was, “so what?” But! I’ve been using make for years. For someone new to everything, I think this shows that CMake is easier to reason about. It just wasn’t enough to sway me from my more familiar make.

      Criticism aside, I really liked the style of the tutorial, and how the repo is all inclusive. I hope to see more tutorials in the future adopt this style (instead of the typical blog post that isn’t all encompassing without linking out to somewhere else, etc).

      1. 3

        As someone who’s used cmake professionally, I agree! It’s a bit simplistic for the basic use-case, with the exception of showing the link capabilities. It also doesn’t mention the other main advantage: once you’ve written the CMakeLists file, you can take it to other systems and (usually)get a clean make system: linux, *BSD, OSX, even Windows(by generating Visual Studio solution files, or Cygwin).

        This is also timely: I’ve been keeping a tool/library evaluation repo for a personal project, using cmake to make sure they all work. Would people be interested in this repo if I added docs similar to this tutorial?

        1. 1

          This is also timely: I’ve been keeping a tool/library evaluation repo for a personal project, using cmake to make sure they all work. Would people be interested in this repo if I added docs similar to this tutorial?

          Yes, absolutely!

          1. 1

            Ok, I’ll clean it out and see if I can get it up in the next few days.

            (Also, I’d like to echo apg’s compliments on the style of the tutorial: it is a good introduction for people totally unfamiliar with CMake)

      2. 1

        As such, I left the tutorial with no reason to care about CMake, and instead of a “woah! you knocked my socks off!”, my reaction was, “so what?” But! I’ve been using make for years. For someone new to everything, I think this shows that CMake is easier to reason about. It just wasn’t enough to sway me from my more familiar make.

        Yup you are right. My intention was not to convince anyone to use a CMake instead of plain Makefile (or any other tool x), but to helps them to quickly get up and running with CMake if they want to use CMake.

        Criticism aside, I really liked the style of the tutorial, and how the repo is all inclusive.

        Thanks!

    4. 2

      Excellent. I’ve never before wanted to use CMake, now I do. Seeing the way gtest was included so easily, following that through to the gtest CMakeLists.txt, and finding another library definition like your example illustrated the multi-project structure as well.

      Thank you for the post! I wish I had more than one upvote to give.