How it works

We have seen that the output of the configuration step was unchanged compared to the previous recipe. The output of the compilation step and the contents of the build directory will however be different, as every generator has its own specific set of files:

  • build.ninja and rules.ninja: Contain all the build statements and build rules for Ninja.
  • CMakeCache.txt: CMake always generates its own cache in this file, regardless of the chosen generator.
  • CMakeFiles: Contains temporary files generated by CMake during configuration.
  • cmake_install.cmake: CMake script handling install rules and which is used at install time.

Note how cmake --build . wrapped the ninja command in a unified, cross-platform interface.

Get CMake Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.