The latest version of this document lives in the vcpkg repo.
Execute a process with logging and fail the build if the command fails.
vcpkg_execute_required_process(
COMMAND <${PERL}> [<arguments>...]
WORKING_DIRECTORY <${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg>
LOGNAME <build-${TARGET_TRIPLET}-dbg>
[TIMEOUT <seconds>]
[OUTPUT_VARIABLE <var>]
[ERROR_VARIABLE <var>]
[SAVE_LOG_FILES <relative-path> [ALIAS <unique-alias>] [<relative-path>...]]
)
Allows the command to execute in Download Mode. See execute_process() override.
The command to be executed, along with its arguments.
The directory to execute the command in.
The prefix to use for the log files.
Optional timeout after which to terminate the command.
Optional variable to receive stdout of the command.
Optional variable to receive stderr of the command.
This should be a unique name for different triplets so that the logs don't conflict when building multiple at once.
Optional files to be moved from the working directory to ${CURRENT_BUILDTREES_DIR}
.
The files are copied even if the process failed.
This helps to collect relevant log files in CI setups.
The target filename is constructed from the LOGNAME
parameter and the parameter of the ALIAS
keyword following the source path.
If ALIAS
is absent, the target filename is constructed from the LOGNAME
parameter, the source filename,
and the suffix .log
if the source filename doesn't already end with this suffix.