diff options
Diffstat (limited to 'scripts/cmake/vcpkg_execute_required_process.cmake')
| -rw-r--r-- | scripts/cmake/vcpkg_execute_required_process.cmake | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake index 2e9ba7058..f25a5b55e 100644 --- a/scripts/cmake/vcpkg_execute_required_process.cmake +++ b/scripts/cmake/vcpkg_execute_required_process.cmake @@ -11,6 +11,10 @@ ## ) ## ``` ## ## Parameters +## ### ALLOW_IN_DOWNLOAD_MODE +## Allows the command to execute in Download Mode. +## [See execute_process() override](../../scripts/cmake/execute_process.cmake). +## ## ### COMMAND ## The command to be executed, along with its arguments. ## @@ -28,11 +32,22 @@ ## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake) ## * [boost](https://github.com/Microsoft/vcpkg/blob/master/ports/boost/portfile.cmake) ## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) +include(vcpkg_prettify_command) function(vcpkg_execute_required_process) - cmake_parse_arguments(vcpkg_execute_required_process "" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) + cmake_parse_arguments(vcpkg_execute_required_process "ALLOW_IN_DOWNLOAD_MODE" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log") set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log") - execute_process( + + set(execute_process_function execute_process) + if (DEFINED VCPKG_DOWNLOAD_MODE AND NOT vcpkg_execute_required_process_ALLOW_IN_DOWNLOAD_MODE) + message(FATAL_ERROR +[[ +This command cannot be executed in Download Mode. +Halting portfile execution. +]]) + endif() + + _execute_process( COMMAND ${vcpkg_execute_required_process_COMMAND} OUTPUT_FILE ${LOG_OUT} ERROR_FILE ${LOG_ERR} @@ -53,8 +68,9 @@ function(vcpkg_execute_required_process) file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG) list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n") endforeach() + vcpkg_prettify_command(vcpkg_execute_required_process_COMMAND vcpkg_execute_required_process_COMMAND_PRETTY) message(FATAL_ERROR - " Command failed: ${vcpkg_execute_required_process_COMMAND}\n" + " Command failed: ${vcpkg_execute_required_process_COMMAND_PRETTY}\n" " Working Directory: ${vcpkg_execute_required_process_WORKING_DIRECTORY}\n" " Error code: ${error_code}\n" " See logs for more information:\n" |
