Skip to content

Commit fb77af8

Browse files
authored
MERGE: pull request #18 from threeal/bump-cpm
Bump CPM.cmake to v0.38.1
2 parents 84ee115 + b544d99 commit fb77af8

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

cmake/CPM.cmake

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set(CPM_DOWNLOAD_VERSION 0.36.0)
1+
set(CPM_DOWNLOAD_VERSION 0.38.1)
22

33
if(CPM_SOURCE_CACHE)
44
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
@@ -10,10 +10,22 @@ endif()
1010

1111
# Expand relative path. This is important if the provided path contains a tilde (~)
1212
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
13-
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
13+
14+
function(download_cpm)
1415
message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}")
1516
file(DOWNLOAD https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
1617
${CPM_DOWNLOAD_LOCATION})
18+
endfunction()
19+
20+
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
21+
download_cpm()
22+
else()
23+
# resume download if it previously failed
24+
file(READ ${CPM_DOWNLOAD_LOCATION} check)
25+
if("${check}" STREQUAL "")
26+
download_cpm()
27+
endif()
28+
unset(check)
1729
endif()
1830

1931
include(${CPM_DOWNLOAD_LOCATION})

0 commit comments

Comments
 (0)