Commit bf0d02de authored by jcfr's avatar jcfr
Browse files

COMP: Superbuild - Change macro downloadFile into function - Check also if downloaded file exists

git-svn-id: http://svn.slicer.org/Slicer4/trunk@13563 3bd1e089-480b-0410-8dfb-8563597acbee
parent 8002241d
......@@ -53,14 +53,14 @@ set(CMAKE_MODULE_PATH
# Convenient macro allowing to download a file
#------------------------------------------------------------------------------
MACRO(downloadFile url dest)
FUNCTION(downloadFile url dest)
FILE(DOWNLOAD ${url} ${dest} STATUS status)
LIST(GET status 0 error_code)
LIST(GET status 1 error_msg)
IF(error_code)
MESSAGE(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}")
IF(error_code OR NOT EXISTS ${dest})
MESSAGE(FATAL_ERROR "error: Failed to download ${url}")
ENDIF()
ENDMACRO()
ENDFUNCTION()
#-----------------------------------------------------------------------------
# Prerequisites
......
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