CMake vs. Make

One thing you notice right away in KDevelop is that they like to use CMake. Up until now I’ve always just used Make, I mean path of least resistance, right?

There’s a great blog post on Perpetual Enigma about the differences, so I’ll just summarize here. Make will always be used as it’s part of the CMake build process, but CMake adds what’s basically an abstraction layer to create the Makefile per platform you’re building on. It stands for Cross-platform Make after all. Which is the intent of my project(s) right now – developing with the ClockworkPi GameShell in mind as the target, but where the game itself would be able to scale up and build on basically any device. I’m not necessarily planning to build to too many targets, but I like being able to.

The basic process is as follows:

CMake -> Generates Makefile -> make all to build with the appropriate compiler and linker on current platform.

I feel like I’m falling down a good few rabbit holes here, but ones that are ultimately in line with major project goals.

Meanwhile, I’ve tried a few things with the project building it with different Makefiles and get some errors with cJSON, which says that it really isn’t supposed to be built with a c++ compiler like the g++ I’ve been using. I’ve also gone back to Eclipse to see if I’m going mad and just checked in a broken version to my gitea server. Eclipse can still build out fine, but this ultimately doesn’t get me anywhere considering I need to use a more simple CLI build environment on the target device because the CPi GameShell likely lacks the system resources required to both run Eclipse IDE GUI and build. I’m sure there’s a CLI mode or something, but I’m perfectly fine using Make as I have already, or in this new case Make as a part of CMake.

So I’m trying the CMake official tutorials.

Leave a Reply

Your email address will not be published. Required fields are marked *