diff options
author | Brad King <brad.king@kitware.com> | 2021-03-10 16:37:09 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-03-10 16:37:15 (GMT) |
commit | 03193a9e9a7e045dd132049dd613dca07b98834b (patch) | |
tree | b944164e5cc47f02ccc6b0aac4261f26a1b6af9f /Modules/ExternalProject-verify.cmake.in | |
parent | 589106be681e8551c1a9a5f85325b9a32e7fe0f2 (diff) | |
parent | 57d442e182bcb9a4426912ed7ba68b58c4dcc940 (diff) | |
download | CMake-03193a9e9a7e045dd132049dd613dca07b98834b.zip CMake-03193a9e9a7e045dd132049dd613dca07b98834b.tar.gz CMake-03193a9e9a7e045dd132049dd613dca07b98834b.tar.bz2 |
Merge topic 'ep-fc-revert-refactoring'
57d442e182 Revert ExternalProject and FetchContent refactoring
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5898
Diffstat (limited to 'Modules/ExternalProject-verify.cmake.in')
-rw-r--r-- | Modules/ExternalProject-verify.cmake.in | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Modules/ExternalProject-verify.cmake.in b/Modules/ExternalProject-verify.cmake.in new file mode 100644 index 0000000..c06da4e --- /dev/null +++ b/Modules/ExternalProject-verify.cmake.in @@ -0,0 +1,37 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +cmake_minimum_required(VERSION 3.5) + +if("@LOCAL@" STREQUAL "") + message(FATAL_ERROR "LOCAL can't be empty") +endif() + +if(NOT EXISTS "@LOCAL@") + message(FATAL_ERROR "File not found: @LOCAL@") +endif() + +if("@ALGO@" STREQUAL "") + message(WARNING "File will not be verified since no URL_HASH specified") + return() +endif() + +if("@EXPECT_VALUE@" STREQUAL "") + message(FATAL_ERROR "EXPECT_VALUE can't be empty") +endif() + +message(STATUS "verifying file... + file='@LOCAL@'") + +file("@ALGO@" "@LOCAL@" actual_value) + +if(NOT "${actual_value}" STREQUAL "@EXPECT_VALUE@") + message(FATAL_ERROR "error: @ALGO@ hash of + @LOCAL@ +does not match expected value + expected: '@EXPECT_VALUE@' + actual: '${actual_value}' +") +endif() + +message(STATUS "verifying file... done") |