CMAKE-CONFIGURE-LOG(7) | CMake | CMAKE-CONFIGURE-LOG(7) |
cmake-configure-log - CMake Configure Log
New in version 3.26.
CMake writes a running log, known as the configure log, of certain events that occur during the Configure step. The configure log does not contain a log of all output, errors, or messages printed while configuring a project. It is a log of detailed information about specific events, such as toolchain inspection by try_compile(), meant for use in debugging the configuration of a build tree.
For human use, this version of CMake writes the configure log to the file:
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeConfigureLog.yaml
However, the location and name of the log file may change in future versions of CMake. Tools that read the configure log should get its location using a configureLog query to the cmake-file-api(7). See the Log Versioning section below for details.
The configure log is designed to be both machine- and human-readable.
The log file is a YAML document stream containing zero or more YAML documents separated by document markers. Each document begins with a --- document marker line, contains a single YAML mapping that logs events from one CMake "configure" step, and, if the configure step finished normally, ends with a ... document marker line:
--- events: - kind: "try_compile-v1" # (other fields omitted) - kind: "try_compile-v1" # (other fields omitted) ...
A new document is appended to the log every time CMake configures the build tree and logs new events.
The keys of the each document root mapping are:
Each of the Event Kinds is versioned independently. The set of keys an event's log entry provides is specific to its major version. When an event is logged, the latest version of its event kind that is known to the running version of CMake is always written to the log.
Tools reading the configure log must ignore event kinds and versions they do not understand:
IDEs should write a cmake-file-api(7) query requesting a specific configureLog object version, before running CMake, and then read the configure log only as described by the file-api reply.
In order to make the log human-readable, text blocks are always represented using YAML literal block scalars (|). Since literal block scalars do not support escaping, backslashes and non-printable characters are encoded at the application layer:
Every event kind is represented by a YAML mapping of the form:
kind: "<kind>-v<major>" backtrace: - "<file>:<line> (<function>)" checks: - "Checking for something" #...event-specific keys...
The keys common to all events are:
Additional mapping keys are specific to each (versioned) event kind, described below.
The message(CONFIGURE_LOG) command logs message events.
There is only one message event major version, version 1.
A message-v1 event is a YAML mapping:
kind: "message-v1" backtrace: - "CMakeLists.txt:123 (message)" checks: - "Checking for something" message: | # ...
The keys specific to message-v1 mappings are:
The try_compile() command logs try_compile events.
There is only one try_compile event major version, version 1.
A try_compile-v1 event is a YAML mapping:
kind: "try_compile-v1" backtrace: - "CMakeLists.txt:123 (try_compile)" checks: - "Checking for something" description: "Explicit LOG_DESCRIPTION" directories: source: "/path/to/.../TryCompile-01234" binary: "/path/to/.../TryCompile-01234" cmakeVariables: SOME_VARIABLE: "Some Value" buildResult: variable: "COMPILE_RESULT" cached: true stdout: | # ... exitCode: 0
The keys specific to try_compile-v1 mappings are:
The try_run() command logs try_run events.
There is only one try_run event major version, version 1.
A try_run-v1 event is a YAML mapping:
kind: "try_run-v1" backtrace: - "CMakeLists.txt:456 (try_run)" checks: - "Checking for something" description: "Explicit LOG_DESCRIPTION" directories: source: "/path/to/.../TryCompile-56789" binary: "/path/to/.../TryCompile-56789" buildResult: variable: "COMPILE_RESULT" cached: true stdout: | # ... exitCode: 0 runResult: variable: "RUN_RESULT" cached: true stdout: | # ... stderr: | # ... exitCode: 0
The keys specific to try_run-v1 mappings include those documented by the try_compile-v1 event, plus:
If RUN_OUTPUT_VARIABLE was used, stdout and stderr are captured together, so this will contain both. Otherwise, this will contain only the stdout output.
If RUN_OUTPUT_VARIABLE was used, stdout and stderr are captured together in the stdout key, and this key will not be present. Otherwise, this will contain the stderr output.
2000-2024 Kitware, Inc. and Contributors
April 15, 2024 | 3.28.3 |