diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake index 0913400..0ac7637 100644 --- a/cmake/CPM.cmake +++ b/cmake/CPM.cmake @@ -15,8 +15,15 @@ function(download_cpm) message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}") file(DOWNLOAD https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake - ${CPM_DOWNLOAD_LOCATION} + ${CPM_DOWNLOAD_LOCATION} STATUS CPM_DOWNLOAD_STATUS ) + list(GET CPM_DOWNLOAD_STATUS 0 CPM_DOWNLOAD_STATUS_CODE) + list(GET CPM_DOWNLOAD_STATUS 1 CPM_DOWNLOAD_ERROR_MESSAGE) + if(${CPM_DOWNLOAD_STATUS_CODE} EQUAL 0) + message(STATUS "CPM: Download completed successfully.") + else() + message(FATAL_ERROR "CPM: Error occurred during download: ${CPM_DOWNLOAD_ERROR_MESSAGE}") + endif() endfunction() if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))