Skip to content

Commit f7d5055

Browse files
committed
update CPM.cmake (try to fix style build)
1 parent 88800a0 commit f7d5055

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

cmake/CPM.cmake

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

38
if(CPM_SOURCE_CACHE)
49
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
@@ -11,22 +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-
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+
)
3123

3224
include(${CPM_DOWNLOAD_LOCATION})

0 commit comments

Comments
 (0)