123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- 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")
|