File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 1515 - name : Set CPM version by tag
1616 run : |
1717 mkdir dist
18- sed -e "s/1.0.0-development-version/${GITHUB_REF/refs\/tags\// v}/g" cmake/CPM.cmake > dist/CPM.cmake
19- sed -e "s/1.0.0-development-version/${GITHUB_REF/refs\/tags\// v}/g" \
20- -e "s/EMPTY_HASH_SUM /$(sha256sum cmake /CPM.cmake | cut -d' ' -f1)/" cmake/get_cpm.cmake > dist/get_cpm.cmake
18+ sed -e "s/1.0.0-development-version/${GITHUB_REF/refs\/tags\/v}/g" cmake/CPM.cmake > dist/CPM.cmake
19+ sed -e "s/1.0.0-development-version/${GITHUB_REF/refs\/tags\/v}/g" \
20+ -e "s/CPM_HASH_SUM_PLACEHOLDER /$(sha256sum dist /CPM.cmake | cut -d' ' -f1)/" cmake/get_cpm.cmake > dist/get_cpm.cmake
2121
2222 - name : Upload CPM.cmake to release
2323 uses : svenstaro/upload-release-action@v1-release
Original file line number Diff line number Diff line change 33# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
44
55set (CPM_DOWNLOAD_VERSION 1.0.0-development-version )
6- set (CPM_HASH_SUM "HASH_SUM_PLACEHOLDER " )
6+ set (CPM_HASH_SUM "CPM_HASH_SUM_PLACEHOLDER " )
77
88if (CPM_SOURCE_CACHE)
99 set (CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE} /cpm/CPM_${CPM_DOWNLOAD_VERSION} .cmake" )
@@ -16,20 +16,21 @@ endif()
1616# Expand relative path. This is important if the provided path contains a tilde (~)
1717get_filename_component (CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE )
1818
19- message (STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION} " )
19+ message (STATUS "Using CPM at ${CPM_DOWNLOAD_LOCATION} " )
20+
2021file (
2122 DOWNLOAD
2223 https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION} /CPM.cmake
2324 ${CPM_DOWNLOAD_LOCATION}
2425 STATUS CPM_DOWNLOAD_STATUS
2526 EXPECTED_HASH SHA256=${CPM_HASH_SUM}
2627)
28+
2729list (GET CPM_DOWNLOAD_STATUS 0 CPM_DOWNLOAD_STATUS_CODE)
28- list (GET CPM_DOWNLOAD_STATUS 1 CPM_DOWNLOAD_ERROR_MESSAGE)
29- if (${CPM_DOWNLOAD_STATUS_CODE} EQUAL 0)
30- message (STATUS "CPM: Download completed successfully." )
31- else ()
32- message (FATAL_ERROR "CPM: Error occurred during download: ${CPM_DOWNLOAD_ERROR_MESSAGE} " )
30+ if (NOT ${CPM_DOWNLOAD_STATUS_CODE} EQUAL 0)
31+ # give a fatal error when download fails
32+ list (GET CPM_DOWNLOAD_STATUS 1 CPM_DOWNLOAD_ERROR_MESSAGE)
33+ message (FATAL_ERROR "Error occurred during download of CPM: ${CPM_DOWNLOAD_ERROR_MESSAGE} " )
3334endif ()
3435
3536include (${CPM_DOWNLOAD_LOCATION} )
You can’t perform that action at this time.
0 commit comments