mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2026-01-18 17:21:33 +01:00
Remove logs in get_cpm.cmake script (#508)
* remove all logs from get_cpm.cmake * simplify get_cpm.cmake script
This commit is contained in:
@@ -16,21 +16,9 @@ endif()
|
||||
# Expand relative path. This is important if the provided path contains a tilde (~)
|
||||
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
|
||||
|
||||
message(STATUS "Using CPM at ${CPM_DOWNLOAD_LOCATION}")
|
||||
|
||||
file(
|
||||
DOWNLOAD
|
||||
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
|
||||
${CPM_DOWNLOAD_LOCATION}
|
||||
STATUS CPM_DOWNLOAD_STATUS
|
||||
EXPECTED_HASH SHA256=${CPM_HASH_SUM}
|
||||
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}
|
||||
)
|
||||
|
||||
list(GET CPM_DOWNLOAD_STATUS 0 CPM_DOWNLOAD_STATUS_CODE)
|
||||
if(NOT ${CPM_DOWNLOAD_STATUS_CODE} EQUAL 0)
|
||||
# give a fatal error when download fails
|
||||
list(GET CPM_DOWNLOAD_STATUS 1 CPM_DOWNLOAD_ERROR_MESSAGE)
|
||||
message(FATAL_ERROR "Error occurred during download of CPM: ${CPM_DOWNLOAD_ERROR_MESSAGE}")
|
||||
endif()
|
||||
|
||||
include(${CPM_DOWNLOAD_LOCATION})
|
||||
|
||||
Reference in New Issue
Block a user