Capturing a record of what the traditional build does

Before we add any targets to the configuration, it is often useful to first capture a record of what the traditional build does, and save the output of the configuration and the build step into a log file. For our Vim example, this can be done using the following:

$ ./configure --enable-gui=no... lot of output ...$ make > build.log

In our case (the complete content of build.log is not shown here), we are able to verify which sources are compiled and which compile flags are used (-I. -Iproto -DHAVE_CONFIG_H -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1). From the log file, we can deduce the following:

  • All objects are linked into a single binary
  • No libraries are produced
  • The executable target ...

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.