aboutsummaryrefslogtreecommitdiff
path: root/scripts/cmake/execute_process.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/cmake/execute_process.cmake')
-rw-r--r--scripts/cmake/execute_process.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/cmake/execute_process.cmake b/scripts/cmake/execute_process.cmake
new file mode 100644
index 000000000..51f6ad160
--- /dev/null
+++ b/scripts/cmake/execute_process.cmake
@@ -0,0 +1,20 @@
+## # execute_process
+##
+## Intercepts all calls to execute_process() inside portfiles and fails when Download Mode
+## is enabled.
+##
+## In order to execute a process in Download Mode call `_execute_process()` instead.
+##
+if (NOT DEFINED OVERRIDEN_EXECUTE_PROCESS)
+ set(OVERRIDEN_EXECUTE_PROCESS ON)
+
+ if (DEFINED VCPKG_DOWNLOAD_MODE)
+ macro(execute_process)
+ message(FATAL_ERROR "This command cannot be executed in Download Mode.\nHalting portfile execution.\n")
+ endmacro()
+ else()
+ macro(execute_process)
+ _execute_process(${ARGV})
+ endmacro()
+ endif()
+endif() \ No newline at end of file