CMake configure log CMakeConfigureLog.yaml

CMake uses CMakeConfigureLog.yaml to log configure output. CMakeConfigureLog.yaml replaces CMakeOutput.log and CMakeError.log from older CMake. message(CONFIGURE_LOG) also writes to CMakeConfigureLog.yaml.

CMake can do a variety of configure-time checks that help avoid confusing build errors. The fundamental functions for these checks are try_compile and try_run. Higher level CMake functions like check_source_compiles, check_source_runs, check_symbol_exists, etc. wrap these functions and add logic to only run the check once.

In general for CMake try_compile() and try_run(), include directories are specified like:

try_compile(...
CMAKE_FLAGS -DINCLUDE_DIRECTORIES=${CMAKE_CURRENT_SOURCE_DIR}
)

To preserve the scratch directories, use option:

cmake -Bbuild --debug-trycompile

which will tell the scratch directory used for try_compile() and try_run().

Example of reading CMakeConfigureLog.yaml in Python.