mirror of
				https://github.com/TheLartians/ModernCppStarter.git
				synced 2025-10-31 02:01:33 +01:00 
			
		
		
		
	feature: compare CPM against a given checksum
This is more comprehensive than just comparing against an empty file.
This commit is contained in:
		
							parent
							
								
									e77cb5b008
								
							
						
					
					
						commit
						e071a49023
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -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() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue