2023-08-19 13:53:28 +01:00
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
#
|
2023-09-17 21:35:11 +02:00
|
|
|
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
|
2023-08-19 13:53:28 +01:00
|
|
|
|
2021-01-06 14:40:33 +01:00
|
|
|
set(CPM_DOWNLOAD_VERSION 1.0.0-development-version)
|
2023-09-18 15:01:57 +02:00
|
|
|
set(CPM_HASH_SUM "CPM_HASH_SUM_PLACEHOLDER")
|
2020-08-20 09:32:03 +02:00
|
|
|
|
|
|
|
|
if(CPM_SOURCE_CACHE)
|
|
|
|
|
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
|
|
|
|
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
|
|
|
|
|
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
|
|
|
|
else()
|
|
|
|
|
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
|
|
|
|
endif()
|
|
|
|
|
|
2022-09-13 13:54:57 -07:00
|
|
|
# Expand relative path. This is important if the provided path contains a tilde (~)
|
|
|
|
|
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
|
2022-11-29 18:30:22 +01:00
|
|
|
|
2023-09-18 16:11:03 +02:00
|
|
|
file(DOWNLOAD
|
|
|
|
|
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
|
|
|
|
|
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
|
2023-09-18 14:01:34 +02:00
|
|
|
)
|
2023-09-18 15:01:57 +02:00
|
|
|
|
2020-08-20 09:32:03 +02:00
|
|
|
include(${CPM_DOWNLOAD_LOCATION})
|