Skip to content

Commit

Permalink
Remove logs in get_cpm.cmake script (#508)
Browse files Browse the repository at this point in the history
* remove all logs from get_cpm.cmake

* simplify get_cpm.cmake script
  • Loading branch information
TheLartians authored Sep 18, 2023
1 parent 16c6a3b commit d6d5d0d
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions cmake/get_cpm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})

0 comments on commit d6d5d0d

Please sign in to comment.