File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
- set (CPM_DOWNLOAD_VERSION 0.35 .0)
1
+ set (CPM_DOWNLOAD_VERSION 0.37 .0)
2
2
3
3
if (CPM_SOURCE_CACHE)
4
- # Expand relative path. This is important if the provided path contains a tilde (~)
5
- get_filename_component (CPM_SOURCE_CACHE ${CPM_SOURCE_CACHE} ABSOLUTE )
6
4
set (CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE} /cpm/CPM_${CPM_DOWNLOAD_VERSION} .cmake" )
7
5
elseif (DEFINED ENV{CPM_SOURCE_CACHE})
8
6
set (CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE} /cpm/CPM_${CPM_DOWNLOAD_VERSION} .cmake" )
9
7
else ()
10
8
set (CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR} /cmake/CPM_${CPM_DOWNLOAD_VERSION} .cmake" )
11
9
endif ()
12
10
13
- if (NOT (EXISTS ${CPM_DOWNLOAD_LOCATION} ))
11
+ # Expand relative path. This is important if the provided path contains a tilde (~)
12
+ get_filename_component (CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE )
13
+
14
+ function (download_cpm)
14
15
message (STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION} " )
15
16
file (DOWNLOAD
16
17
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION} /CPM.cmake
17
18
${CPM_DOWNLOAD_LOCATION}
18
19
)
20
+ endfunction ()
21
+
22
+ if (NOT (EXISTS ${CPM_DOWNLOAD_LOCATION} ))
23
+ download_cpm()
24
+ else ()
25
+ # resume download if it previously failed
26
+ file (READ ${CPM_DOWNLOAD_LOCATION} check)
27
+ if ("${check} " STREQUAL "" )
28
+ download_cpm()
29
+ endif ()
19
30
endif ()
20
31
21
32
include (${CPM_DOWNLOAD_LOCATION} )
You can’t perform that action at this time.
0 commit comments