File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 1- set (CPM_DOWNLOAD_VERSION 0.36.0 )
1+ set (CPM_DOWNLOAD_VERSION 0.38.1 )
22
33if (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 (~)
1212get_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)
1729endif ()
1830
1931include (${CPM_DOWNLOAD_LOCATION} )
You can’t perform that action at this time.
0 commit comments