summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject/verify.cmake.in
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2021-01-29 12:22:45 (GMT)
committerCraig Scott <craig.scott@crascit.com>2021-02-04 20:33:38 (GMT)
commit17e5516e608ba5c9c1f2dfad3d64f8f90874f108 (patch)
treeae0f88a262c3734cda45ee1040aee303e131d13d /Modules/ExternalProject/verify.cmake.in
parent4f3d1abbb4dca3d1e6b019471fa5d8be296492e3 (diff)
downloadCMake-17e5516e608ba5c9c1f2dfad3d64f8f90874f108.zip
CMake-17e5516e608ba5c9c1f2dfad3d64f8f90874f108.tar.gz
CMake-17e5516e608ba5c9c1f2dfad3d64f8f90874f108.tar.bz2
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/verify.cmake.in')
-rw-r--r--Modules/ExternalProject/verify.cmake.in22
1 files changed, 16 insertions, 6 deletions
diff --git a/Modules/ExternalProject/verify.cmake.in b/Modules/ExternalProject/verify.cmake.in
index f37059b..cd34ba9 100644
--- a/Modules/ExternalProject/verify.cmake.in
+++ b/Modules/ExternalProject/verify.cmake.in
@@ -3,6 +3,10 @@
cmake_minimum_required(VERSION 3.5)
+set(quiet "@quiet@")
+set(script_dir "@CMAKE_CURRENT_FUNCTION_LIST_DIR@/ExternalProject")
+include(${script_dir}/captured_process_setup.cmake)
+
if("@LOCAL@" STREQUAL "")
message(FATAL_ERROR "LOCAL can't be empty")
endif()
@@ -13,22 +17,27 @@ endif()
function(do_verify)
if("@ALGO@" STREQUAL "")
- message(WARNING "File will not be verified since no URL_HASH specified")
+ _ep_message_quiet_capture(WARNING
+ "File will not be verified since no URL_HASH specified"
+ )
+ set(accumulated_output "${accumulated_output}" PARENT_SCOPE)
return()
endif()
if("@EXPECT_VALUE@" STREQUAL "")
- message(FATAL_ERROR "EXPECT_VALUE can't be empty")
+ _ep_message_quiet_capture(FATAL_ERROR "EXPECT_VALUE can't be empty")
endif()
- message(STATUS
+ _ep_message_quiet_capture(STATUS
"verifying file...
- file='@LOCAL@'")
+ file='@LOCAL@'"
+ )
+ set(accumulated_output "${accumulated_output}" PARENT_SCOPE)
file("@ALGO@" "@LOCAL@" actual_value)
if(NOT "${actual_value}" STREQUAL "@EXPECT_VALUE@")
- message(FATAL_ERROR
+ _ep_message_quiet_capture(FATAL_ERROR
"error: @ALGO@ hash of
@LOCAL@
does not match expected value
@@ -37,7 +46,8 @@ does not match expected value
")
endif()
- message(STATUS "verifying file... done")
+ _ep_message_quiet_capture(STATUS "verifying file... done")
+ set(accumulated_output "${accumulated_output}" PARENT_SCOPE)
endfunction()
do_verify()