neovim/cmake/Download.cmake
ZyX 8204eaea7f cmake: Make Download.cmake check for errors
Copying from third-party/cmake/DownloadAndExtractFile.cmake.
2017-03-31 16:04:17 +03:00

17 lines
305 B
CMake

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()