4 comments

[ 79.7 ms ] story [ 98.6 ms ] thread
this article misses a crucial conceptual point of using a higher-level build tool / meta-build tool with this line

    cd build && make
by not using instead

    cmake --build build/
and then use all the other options available to the cmake --build command. Think of CMake as your multi-platform build tool, not just a "makefile generator".
Yah, absolutely. In the real world that is absolutely the way to go (and I suspect will be managed by your IDE in a lot of cases), but I wanted to show what it means for CMake to be a generator, and Makefiles are the easiest build system to show that with.
yes but nobody cares that it is, because those generated makefiles or ninja files are not user-serviceable, so it might be worth adding a remark to the article (which was very thorough I should emphasise, just that it was missing the reasoning here)

also you might want to consider using

    make --directory build/
which of course leaves the user in the original place, and as such is a bit more ergonomic
(comment deleted)