Skip to content

Commit cf11e52

Browse files
authored
build: simplify CPM.cmake content (#114)
1 parent 20f6fb1 commit cf11e52

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

cmake/CPM.cmake

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
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.7)
6-
set(CPM_HASH_SUM 14ea07dfb484cad5db4ee1c75fd6a911)
7-
8-
if(CPM_SOURCE_CACHE)
9-
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
10-
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
11-
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
12-
else()
13-
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
14-
endif()
15-
16-
# Expand relative path. This is important if the provided path contains a tilde (~)
17-
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
18-
19-
file(DOWNLOAD https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
20-
${CPM_DOWNLOAD_LOCATION} EXPECTED_MD5 ${CPM_HASH_SUM})
21-
22-
include(${CPM_DOWNLOAD_LOCATION})
1+
file(
2+
DOWNLOAD
3+
https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.38.7/CPM.cmake
4+
${CMAKE_BINARY_DIR}/_deps/CPM.cmake
5+
EXPECTED_MD5 14ea07dfb484cad5db4ee1c75fd6a911
6+
)
7+
include(${CMAKE_BINARY_DIR}/_deps/CPM.cmake)

0 commit comments

Comments
 (0)