diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake index 0ac7637..cb95368 100644 --- a/cmake/CPM.cmake +++ b/cmake/CPM.cmake @@ -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()