summaryrefslogtreecommitdiff
path: root/Modules/ExternalProject/customcommand.cmake.in
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2021-01-29 23:22:45 +1100
committerCraig Scott <craig.scott@crascit.com>2021-02-05 07:33:38 +1100
commit17e5516e608ba5c9c1f2dfad3d64f8f90874f108 (patch)
treeae0f88a262c3734cda45ee1040aee303e131d13d /Modules/ExternalProject/customcommand.cmake.in
parent4f3d1abbb4dca3d1e6b019471fa5d8be296492e3 (diff)
downloadcmake-17e5516e608ba5c9c1f2dfad3d64f8f90874f108.tar.gz
FetchContent: Invoke steps directly and avoid a separate sub-build
The cost of setting up and executing a separate sub-build to do the download, update and patch steps required for FetchContent population can be significant with some platforms and CMake generators. Avoid the sub-build altogether by invoking the step scripts directly. Previously, if no generator was set (e.g. population was being done in script mode), a generator needed to be available on the default PATH. Since we no longer use a sub-build, this restriction is also now gone. Fixes: #21703
Diffstat (limited to 'Modules/ExternalProject/customcommand.cmake.in')
-rw-r--r--Modules/ExternalProject/customcommand.cmake.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/ExternalProject/customcommand.cmake.in b/Modules/ExternalProject/customcommand.cmake.in
new file mode 100644
index 0000000000..d41f31b83e
--- /dev/null
+++ b/Modules/ExternalProject/customcommand.cmake.in
@@ -0,0 +1,8 @@
+
+execute_process(
+ COMMAND @this_command@
+ WORKING_DIRECTORY "@work_dir@"
+ RESULT_VARIABLE result
+ ${capture_output}
+)
+_ep_command_check_result(result)