Skip to content

Commit 9f561ec

Browse files
authored
Merge pull request #25 from SSAGESLabs/pz/CPM.cmake
Update CPM.cmake
2 parents a1f0586 + 9c71e38 commit 9f561ec

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

cmake/Modules/FetchCPM.cmake

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
set(CPM_DOWNLOAD_VERSION 0.38.1)
1+
# SPDX-License-Identifier: MIT
2+
#
3+
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
4+
5+
set(CPM_DOWNLOAD_VERSION 0.40.2)
6+
set(CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d")
27

38
if(CPM_SOURCE_CACHE)
49
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
@@ -11,23 +16,9 @@ endif()
1116
# Expand relative path. This is important if the provided path contains a tilde (~)
1217
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
1318

14-
function(download_cpm)
15-
message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}")
16-
file(DOWNLOAD
17-
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
18-
${CPM_DOWNLOAD_LOCATION}
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()
30-
unset(check)
31-
endif()
19+
file(DOWNLOAD
20+
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
21+
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
22+
)
3223

3324
include(${CPM_DOWNLOAD_LOCATION})

0 commit comments

Comments
 (0)