Can you help me understand what the difference of Make, CMake, and Ninja?

This my understanding but I’m relatively new to CMake so take it with a grain of salt. Hopefully someone will chime in if I’m wrong.

CMake is a tool to describe how you want your project built. Which files are being compiled, how many targets, what compiler flags are you using, debug and release. This is where you spend your time, writing your configuration file (CMakelist.txt).

Make and Ninja are called generators. These actually manage the compiling and linking process, checking to see if files have changed and compiling everything for you. They both need configuration files to work but they are tricky to write and very long winded.

So what CMake does is ask you which generator you would like to use (each has its pros and cons) and creates the configuration file for that generator. Cmake will then run the generator using that automatically created config file when your want to build your program.

CMake does a lot of other stuff in the background as well but that’s main gist.

TLDR: CMake provides a high level abstract interface for using low level build tools. Your system needs CMake and one generator (I suggest Ninja as it’s typically faster than Make but it’s trivial to change if you need to).

/r/embedded Thread