|
|
@ -25,16 +25,16 @@ function(download_file URL DEST EXPECTED_MD5)
|
|
|
|
get_filename_component(FILENAME "${URL}" NAME)
|
|
|
|
get_filename_component(FILENAME "${URL}" NAME)
|
|
|
|
file_md5_if_exists("${DEST}" CUR_MD5)
|
|
|
|
file_md5_if_exists("${DEST}" CUR_MD5)
|
|
|
|
|
|
|
|
|
|
|
|
search_downloads(${EXPECTED_MD5} DLPATH)
|
|
|
|
|
|
|
|
if(NOT("${DLPATH}" STREQUAL ""))
|
|
|
|
|
|
|
|
message("* Copying ${FILENAME} from ${DLPATH}")
|
|
|
|
|
|
|
|
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy
|
|
|
|
|
|
|
|
"${DLPATH}"
|
|
|
|
|
|
|
|
"${DEST}")
|
|
|
|
|
|
|
|
return()
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(NOT "${EXPECTED_MD5}" STREQUAL "${CUR_MD5}")
|
|
|
|
if(NOT "${EXPECTED_MD5}" STREQUAL "${CUR_MD5}")
|
|
|
|
|
|
|
|
search_downloads(${EXPECTED_MD5} DLPATH)
|
|
|
|
|
|
|
|
if(NOT("${DLPATH}" STREQUAL ""))
|
|
|
|
|
|
|
|
message("* Copying ${FILENAME} from ${DLPATH}")
|
|
|
|
|
|
|
|
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy
|
|
|
|
|
|
|
|
"${DLPATH}"
|
|
|
|
|
|
|
|
"${DEST}")
|
|
|
|
|
|
|
|
return()
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
message("* Downloading ${FILENAME}")
|
|
|
|
message("* Downloading ${FILENAME}")
|
|
|
|
file(DOWNLOAD "${URL}" "${DEST}" EXPECTED_MD5 "${EXPECTED_MD5}" SHOW_PROGRESS)
|
|
|
|
file(DOWNLOAD "${URL}" "${DEST}" EXPECTED_MD5 "${EXPECTED_MD5}" SHOW_PROGRESS)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|