Commit d9847c23 authored by jcfr's avatar jcfr
Browse files

COMP: CMakeLists.txt - Update cmake macro downloadFile to check if the file is...

COMP: CMakeLists.txt - Update cmake macro downloadFile to check if the file is empty and attempt re-download if needed

This macro is mainly used to download FindCTK.cmake from the commontk
github repository.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@13895 3bd1e089-480b-0410-8dfb-8563597acbee
parent ca2906d4
......@@ -40,6 +40,13 @@ MACRO(downloadFile url dest)
IF(error_code)
MESSAGE(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}")
ENDIF()
ELSE()
# Make sure the file is not empty
FILE(READ ${dest} dest_content)
IF(dest_content STREQUAL "")
FILE(REMOVE ${dest})
downloadFile(${url} ${dest})
ENDIF()
ENDIF()
ENDMACRO()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment