summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/navit_download.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/navit_download.cmake b/cmake/navit_download.cmake
index 963f9724f..6f6cc8f51 100644
--- a/cmake/navit_download.cmake
+++ b/cmake/navit_download.cmake
@@ -1,2 +1,8 @@
message("Downloading ${URL}")
-file(DOWNLOAD ${URL} ${DST} SHOW_PROGRESS)
+file(DOWNLOAD ${URL} ${DST} SHOW_PROGRESS STATUS DOWNLOAD_STATUS)
+list(GET DOWNLOAD_STATUS 0 DOWNLOAD_ERR)
+list(GET DOWNLOAD_STATUS 1 DOWNLOAD_MSG)
+if(DOWNLOAD_ERR)
+ message(WARNING "Download of sample map from ${URL} failed: ${DOWNLOAD_MSG}.")
+ file(REMOVE ${DST})
+endif(DOWNLOAD_ERR)