mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00

Refactoring of the ExternalProject and FetchContent modules moved the commands into CMake scripts. This broke custom commands that used shell redirection or special build tool variables of the form $(MakeVar). Undo the sequence of commits that performed this refactoring and follow-up fixes associated with it. The following commits are reverted by this change:4f3d1abbb4
(ExternalProject: Refactor pre-configure steps to support no-target uses, 2021-02-05)17e5516e60
(FetchContent: Invoke steps directly and avoid a separate sub-build, 2021-01-29)bd876f3849
(FetchContent: Restore patch command support, 2021-02-18)404cddb7bb
(ExternalProject: Fix misuse of IS_NEWER_THAN in timestamp checks, 2021-02-21)b0da671243
(FetchContent: Don't update timestamps if files don't change, 2021-02-18) Fixes: #21892
38 lines
904 B
CMake
38 lines
904 B
CMake
# 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")
|