-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Minimal CMake
By :
In the Invoking CMake section, we glossed over what was happening when we ran cmake -B build. When we run cmake -B build, we’re asking CMake to generate build files for us, but what build files? CMake will do its best to pick the platform default; this is Visual Studio on Windows and Make on macOS and Linux. A list of all potential generators can be found by visiting https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html or by running the cmake --help command (the default generator is displayed with an asterisk). To check what generator is being used if you’re unsure, you can open the CMakeCache.txt file inside the build/ folder and search for CMAKE_GENERATOR. There you should find a line such as the following:
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
The CMake cache variable (another topic we’ll cover in greater depth later) is marked as INTERNAL, so we shouldn’t depend on this in our scripts, but as a debugging aid it&...