aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/Download.cmake17
1 files changed, 16 insertions, 1 deletions
diff --git a/cmake/Download.cmake b/cmake/Download.cmake
index 07ec174852..470bb19a08 100644
--- a/cmake/Download.cmake
+++ b/cmake/Download.cmake
@@ -1 +1,16 @@
-file(DOWNLOAD "${URL}" "${FILE}")
+file(
+ DOWNLOAD "${URL}" "${FILE}"
+ STATUS status
+ LOG log
+)
+
+list(GET status 0 status_code)
+list(GET status 1 status_string)
+
+if(NOT status_code EQUAL 0)
+ message(FATAL_ERROR "error: downloading '${URL}' failed
+ status_code: ${status_code}
+ status_string: ${status_string}
+ log: ${log}
+")
+endif()