Mercurial > hg > orthanc-object-storage
comparison Common/Resources/Orthanc/CMake/DownloadPackage.cmake @ 110:37a4b8e2577f
sync orthanc + SDK 1.12.1
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 10 Oct 2023 15:40:36 +0200 |
parents | f3c44d61e1e1 |
children | 40efe821932a |
comparison
equal
deleted
inserted
replaced
109:2549eecdc996 | 110:37a4b8e2577f |
---|---|
1 # Orthanc - A Lightweight, RESTful DICOM Store | 1 # Orthanc - A Lightweight, RESTful DICOM Store |
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | 2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
3 # Department, University Hospital of Liege, Belgium | 3 # Department, University Hospital of Liege, Belgium |
4 # Copyright (C) 2017-2021 Osimis S.A., Belgium | 4 # Copyright (C) 2017-2023 Osimis S.A., Belgium |
5 # Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium | |
5 # | 6 # |
6 # This program is free software: you can redistribute it and/or | 7 # This program is free software: you can redistribute it and/or |
7 # modify it under the terms of the GNU Lesser General Public License | 8 # modify it under the terms of the GNU Lesser General Public License |
8 # as published by the Free Software Foundation, either version 3 of | 9 # as published by the Free Software Foundation, either version 3 of |
9 # the License, or (at your option) any later version. | 10 # the License, or (at your option) any later version. |
98 # https://code.google.com/p/orthanc/issues/detail?id=6 | 99 # https://code.google.com/p/orthanc/issues/detail?id=6 |
99 if (NOT STATIC_BUILD AND NOT ALLOW_DOWNLOADS) | 100 if (NOT STATIC_BUILD AND NOT ALLOW_DOWNLOADS) |
100 message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON") | 101 message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON") |
101 endif() | 102 endif() |
102 | 103 |
103 if ("${MD5}" STREQUAL "no-check") | 104 foreach (retry RANGE 1 5) # Retries 5 times |
104 message(WARNING "Not checking the MD5 of: ${Url}") | 105 if ("${MD5}" STREQUAL "no-check") |
105 file(DOWNLOAD "${Url}" "${TMP_PATH}" | 106 message(WARNING "Not checking the MD5 of: ${Url}") |
106 SHOW_PROGRESS TIMEOUT 300 INACTIVITY_TIMEOUT 60 | 107 file(DOWNLOAD "${Url}" "${TMP_PATH}" |
107 STATUS Failure) | 108 SHOW_PROGRESS TIMEOUT 30 INACTIVITY_TIMEOUT 10 |
108 else() | 109 STATUS Failure) |
109 file(DOWNLOAD "${Url}" "${TMP_PATH}" | 110 else() |
110 SHOW_PROGRESS TIMEOUT 300 INACTIVITY_TIMEOUT 60 | 111 file(DOWNLOAD "${Url}" "${TMP_PATH}" |
111 EXPECTED_MD5 "${MD5}" STATUS Failure) | 112 SHOW_PROGRESS TIMEOUT 30 INACTIVITY_TIMEOUT 10 |
112 endif() | 113 EXPECTED_MD5 "${MD5}" STATUS Failure) |
113 | 114 endif() |
114 list(GET Failure 0 Status) | 115 |
116 list(GET Failure 0 Status) | |
117 if (Status EQUAL 0) | |
118 break() # Successful download | |
119 endif() | |
120 endforeach() | |
121 | |
115 if (NOT Status EQUAL 0) | 122 if (NOT Status EQUAL 0) |
123 file(REMOVE ${TMP_PATH}) | |
116 message(FATAL_ERROR "Cannot download file: ${Url}") | 124 message(FATAL_ERROR "Cannot download file: ${Url}") |
117 endif() | 125 endif() |
118 | 126 |
119 else() | 127 else() |
120 message("Using local copy of ${Url}") | 128 message("Using local copy of ${Url}") |