aboutsummaryrefslogtreecommitdiff
path: root/scripts/cmake/vcpkg_execute_required_process.cmake
diff options
context:
space:
mode:
authorVictor Romero <romerosanchezv@gmail.com>2019-08-28 11:47:17 -0700
committerGitHub <noreply@github.com>2019-08-28 11:47:17 -0700
commit65d4bc146bf7c1c21989b680497b1f6f9a09c967 (patch)
tree31e564677ff7ae3f065c3bd3d7448ba959edb524 /scripts/cmake/vcpkg_execute_required_process.cmake
parentfc135e20eae801bcd6a20ddb8fba677f61dba5a5 (diff)
downloadvcpkg-65d4bc146bf7c1c21989b680497b1f6f9a09c967.tar.gz
vcpkg-65d4bc146bf7c1c21989b680497b1f6f9a09c967.zip
[vcpkg install] Enable Download Mode (#7797)
* [portfile functions] Override execute_process() to accept ALLOW_IN_DOWNLOAD_MODE option * [vcpkg install] Set VCPKG_DOWNLOAD_MODE when using --only-downloads option * [vcpkg_find_acquire_program] Allow in Download Mode * Don't stop when build fails for a package * Download sources for all packages in dependency graph * Improve output messages * Enable acquiring MSYS packages in download mode * Documentation * Update documentation * execute_process() always fails on Download Mode * Regenerate docs and fix formatting * Run clang-format * Use _execute_process on vcpkg_from_<source> helpers
Diffstat (limited to 'scripts/cmake/vcpkg_execute_required_process.cmake')
-rw-r--r--scripts/cmake/vcpkg_execute_required_process.cmake18
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake
index e65d1970a..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.
##
@@ -30,10 +34,20 @@
## * [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}