diff options
author | Johnny Jazeix <jazeix@gmail.com> | 2019-12-23 09:35:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-01-15 15:03:35 (GMT) |
commit | c0da651c09e11f9868529b7f8c4dc8f97c4546c8 (patch) | |
tree | 2c83d48dba0e6bdde0b710b5f89dca4199c4eb7b /Tests/CMakeTests/FileDownloadTest.cmake.in | |
parent | b56d429324330a9eb8d3c1860333969140851dd7 (diff) | |
download | CMake-c0da651c09e11f9868529b7f8c4dc8f97c4546c8.zip CMake-c0da651c09e11f9868529b7f8c4dc8f97c4546c8.tar.gz CMake-c0da651c09e11f9868529b7f8c4dc8f97c4546c8.tar.bz2 |
file(DOWNLOAD): Don't fail if given just a filename to write to
Fixes: #17969
Diffstat (limited to 'Tests/CMakeTests/FileDownloadTest.cmake.in')
-rw-r--r-- | Tests/CMakeTests/FileDownloadTest.cmake.in | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/CMakeTests/FileDownloadTest.cmake.in b/Tests/CMakeTests/FileDownloadTest.cmake.in index 6c1ee75..5bd3803 100644 --- a/Tests/CMakeTests/FileDownloadTest.cmake.in +++ b/Tests/CMakeTests/FileDownloadTest.cmake.in @@ -145,3 +145,21 @@ file(DOWNLOAD ) message(STATUS "${status}") __reportIfWrongStatus("${status}" 6) # 6 corresponds to an unresolvable host name + +message(STATUS "FileDownload:12") +set(absFile "@CMAKE_CURRENT_BINARY_DIR@/file12.png") +if(EXISTS "${absFile}") + file(RENAME ${absFile} "${absFile}_beingRemoved") + file(REMOVE "${absFile}_beingRemoved") +endif() +file(DOWNLOAD + ${url} + file12.png + TIMEOUT ${timeout} + EXPECTED_MD5 dbd330d52f4dbd60115d4191904ded92 + STATUS status + ) +__reportIfWrongStatus("${status}" 0) +if(NOT EXISTS file12.png) + message(SEND_ERROR "file12.png not downloaded: ${status}") +endif() |