You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
946 B

# 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 ${CMAKE_VERSION}) # this file comes with cmake
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 cannot be verified since no URL_HASH specified")
return()
endif()
if("@EXPECT_VALUE@" STREQUAL "")
message(FATAL_ERROR "EXPECT_VALUE can't be empty")
endif()
message(VERBOSE "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(VERBOSE "verifying file... done")