I use plain GNU Make often. I typically see no need for cmake or any other meta-build system in my use cases.
What cmake and autotools allegdly bring to the table is easier build portability. Well, I rarely care about that. I am always going to have precise control over the build environment and platform. So plain old GNU Make works great.
I don't see how any of those conditions you list challenge vanilla GNU Make. Very easily dealt with.
All CMake does is introduce another layer of abstraction and in theory make it more likely you can build in a very different environment without tweaking anything.
because in 2018 the job is "compile& run on windows, mac, linux with glibc, linux with musl, steamos, android, iOS, jolla, ubuntu phone, plasma mobile, emscripten with asmjs, emscripten with webassembly, retroarch core, ps3, ps4, xbox 1, homebrew dreamcast emulator". I'm only exagerrating a bit ; I don't remember the last game I bought that didn't at least run on linux / macos / windows.
I can't think of any advantage that makefiles has over CMake except perhaps that some authors are more familiar with them. Other than that? No, use CMake.
Tight shell integration. You can easily have Make cause all sorts of things to happen during the build. CMake is this arcane, poorly documented, and limited string macro processor that is a waste of time to bang your head against trying to make it do things. Shell and Make suck in their own ways, but not enough to justify CMake unless you need to build on disparate platforms.
cmake_minimum_required(VERSION 3.10)
project(example LANGUAGE C)
add_executable(hello hellomake.c hellofunc.c)
target_include_directories(hello ${CMAKE_CURRENT_SOURCE_DIR})
It's like saying "assembly does the job pretty well, so why bother with C++ which is a giant beast."
And good luck managing dependencies and flags to individual targets with make.
32
u/notbatmanyet Jan 09 '18
Cmake is the defacto standard modern buildsystem. I would recommend it.