1
0
Fork 0
mirror of https://github.com/TheLartians/ModernCppStarter.git synced 2025-08-30 21:51:12 +02:00

feature: compare CPM against a given checksum

This is more comprehensive than just comparing against an empty file.
This commit is contained in:
Tobias Schmidl 2023-05-04 10:04:02 +02:00
parent e77cb5b008
commit e071a49023

View file

@ -1,4 +1,5 @@
set(CPM_DOWNLOAD_VERSION 0.38.1)
set(CPM_HASH_SUM "9d2072c167bd4b08fb60087553c146515e3f5be061353c321a6d5496eb4bf9ea")
if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
@ -30,8 +31,8 @@ if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
download_cpm()
else()
# resume download if it previously failed
file(READ ${CPM_DOWNLOAD_LOCATION} check)
if("${check}" STREQUAL "")
file(SHA256 ${CPM_DOWNLOAD_LOCATION} CPM_CHECK)
if(NOT "${CPM_CHECK}" STREQUAL CPM_HASH_SUM)
download_cpm()
endif()
endif()