# HG changeset patch # User Sebastien Jodogne # Date 1538493895 -7200 # Node ID 706da802f1e3ab01e07bb5b0015963ffe1b4b2d5 # Parent ebb3f2aa5f23b5f21d7ff275ed13cb9b9fc46899 fix checking of MD5 in CMake, new option "no-check" for MD5 diff -r ebb3f2aa5f23 -r 706da802f1e3 Resources/CMake/DownloadPackage.cmake --- a/Resources/CMake/DownloadPackage.cmake Tue Oct 02 17:05:36 2018 +0200 +++ b/Resources/CMake/DownloadPackage.cmake Tue Oct 02 17:24:55 2018 +0200 @@ -73,19 +73,22 @@ # 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() - if (MD5) + if ("${MD5}" STREQUAL "no-check") + message(WARNING "Not checking the MD5 of: ${Url}") + file(DOWNLOAD "${Url}" "${TMP_PATH}" SHOW_PROGRESS TIMEOUT 60 INACTIVITY_TIMEOUT 60) + else() 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}") - if (MD5) + if ("${MD5}" STREQUAL "no-check") + message(WARNING "Not checking the MD5 of: ${Url}") + else() 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}")