Mercurial > hg > orthanc
changeset 2854:ebb3f2aa5f23
merge
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 02 Oct 2018 17:05:36 +0200 |
parents | 52b017d22a4f (current diff) d4f44a8028a1 (diff) |
children | 706da802f1e3 |
files | |
diffstat | 1 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/Resources/CMake/DownloadPackage.cmake Tue Oct 02 17:05:07 2018 +0200 +++ b/Resources/CMake/DownloadPackage.cmake Tue Oct 02 17:05:36 2018 +0200 @@ -73,18 +73,23 @@ # user know." # https://code.google.com/p/orthanc/issues/detail?id=6 if (NOT STATIC_BUILD AND NOT ALLOW_DOWNLOADS) - message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON") + message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON") endif() - file(DOWNLOAD "${Url}" "${TMP_PATH}" - SHOW_PROGRESS EXPECTED_MD5 "${MD5}" - TIMEOUT 60 INACTIVITY_TIMEOUT 60) + if (MD5) + file(DOWNLOAD "${Url}" "${TMP_PATH}" SHOW_PROGRESS TIMEOUT 60 INACTIVITY_TIMEOUT 60 EXPECTED_MD5 "${MD5}") + else() + file(DOWNLOAD "${Url}" "${TMP_PATH}" SHOW_PROGRESS TIMEOUT 60 INACTIVITY_TIMEOUT 60) + endif() + else() message("Using local copy of ${Url}") - file(MD5 ${TMP_PATH} ActualMD5) - if (NOT "${ActualMD5}" STREQUAL "${MD5}") - message(FATAL_ERROR "The MD5 hash of a previously download file is invalid: ${TMP_PATH}") + if (MD5) + file(MD5 ${TMP_PATH} ActualMD5) + if (NOT "${ActualMD5}" STREQUAL "${MD5}") + message(FATAL_ERROR "The MD5 hash of a previously download file is invalid: ${TMP_PATH}") + endif() endif() endif()