There is more

The official documentation at https://cmake.org/runningcmake/ gives a concise overview on running CMake. The build system generated by CMake, the Makefile in the example given above, will contain targets and rules to build object files, executables, and libraries for the given project. The hello-world executable was our only target in the current example, but running the command:

$ cmake --build . --target helpThe following are some of the valid targets for this Makefile:... all (the default if no target is provided)... clean... depend... rebuild_cache... hello-world... edit_cache... hello-world.o... hello-world.i... hello-world.s

reveals that CMake generates more targets than those strictly needed for building the executable ...

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.