comparison Common/Resources/Orthanc/CMake/DownloadOrthancFramework.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 a3590caf93a3
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.
69 string(REGEX REPLACE ${RE} "\\3" ORTHANC_FRAMEWORK_REVISION ${ORTHANC_FRAMEWORK_VERSION}) 70 string(REGEX REPLACE ${RE} "\\3" ORTHANC_FRAMEWORK_REVISION ${ORTHANC_FRAMEWORK_VERSION})
70 71
71 if (NOT ORTHANC_FRAMEWORK_MAJOR MATCHES "^[0-9]+$" OR 72 if (NOT ORTHANC_FRAMEWORK_MAJOR MATCHES "^[0-9]+$" OR
72 NOT ORTHANC_FRAMEWORK_MINOR MATCHES "^[0-9]+$" OR 73 NOT ORTHANC_FRAMEWORK_MINOR MATCHES "^[0-9]+$" OR
73 NOT ORTHANC_FRAMEWORK_REVISION MATCHES "^[0-9]+$") 74 NOT ORTHANC_FRAMEWORK_REVISION MATCHES "^[0-9]+$")
74 message("Bad version of the Orthanc framework: ${ORTHANC_FRAMEWORK_VERSION}") 75 message("Bad version of the Orthanc framework, assuming a pre-release: ${ORTHANC_FRAMEWORK_VERSION}")
76 set(ORTHANC_FRAMEWORK_MAJOR 999)
77 set(ORTHANC_FRAMEWORK_MINOR 999)
78 set(ORTHANC_FRAMEWORK_REVISION 999)
75 endif() 79 endif()
76 80
77 if (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.3.1") 81 if (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.3.1")
78 set(ORTHANC_FRAMEWORK_MD5 "dac95bd6cf86fb19deaf4e612961f378") 82 set(ORTHANC_FRAMEWORK_MD5 "dac95bd6cf86fb19deaf4e612961f378")
79 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.3.2") 83 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.3.2")
128 set(ORTHANC_FRAMEWORK_MD5 "08eebc66ef93c3b40115c38501db5fbd") 132 set(ORTHANC_FRAMEWORK_MD5 "08eebc66ef93c3b40115c38501db5fbd")
129 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.2") 133 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.2")
130 set(ORTHANC_FRAMEWORK_MD5 "3ea66c09f64aca990016683b6375734e") 134 set(ORTHANC_FRAMEWORK_MD5 "3ea66c09f64aca990016683b6375734e")
131 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.3") 135 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.3")
132 set(ORTHANC_FRAMEWORK_MD5 "9b86e6f00e03278293cd15643cc0233f") 136 set(ORTHANC_FRAMEWORK_MD5 "9b86e6f00e03278293cd15643cc0233f")
137 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.4")
138 set(ORTHANC_FRAMEWORK_MD5 "6d5ca4a73ac7d42445041ca79de1624d")
139 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.5")
140 set(ORTHANC_FRAMEWORK_MD5 "10fc64de1254a095e5d3ed3931f0cfbb")
141 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.6")
142 set(ORTHANC_FRAMEWORK_MD5 "4b5d05683d747c29b2860ad79d11e62e")
143 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.7")
144 set(ORTHANC_FRAMEWORK_MD5 "c912bbb860d640d3ae3003b5c9698205")
145 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.10.0")
146 set(ORTHANC_FRAMEWORK_MD5 "8610c82d9153f22e929f2110f8f60279")
147 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.10.1")
148 set(ORTHANC_FRAMEWORK_MD5 "caf667fc5ea452b3d0c2f70bfd02599c")
149 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.11.0")
150 set(ORTHANC_FRAMEWORK_MD5 "962c4a4a706a2ef28b390d8515dd7091")
151 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.11.1")
152 set(ORTHANC_FRAMEWORK_MD5 "a39661c406adf22cf574fde290cf4bbf")
153 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.11.2")
154 set(ORTHANC_FRAMEWORK_MD5 "ede3de356493a8868545f8cb4b8bc8b5")
155 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.11.3")
156 set(ORTHANC_FRAMEWORK_MD5 "f941c0f5771db7616e7b7961026a60e2")
157 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.12.0")
158 set(ORTHANC_FRAMEWORK_MD5 "d32a0cde03b6eb603d8dd2b33d38bf1b")
159 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.12.1")
160 set(ORTHANC_FRAMEWORK_MD5 "8a435140efc8ff4a01d8242f092f21de")
133 161
134 # Below this point are development snapshots that were used to 162 # Below this point are development snapshots that were used to
135 # release some plugin, before an official release of the Orthanc 163 # release some plugin, before an official release of the Orthanc
136 # framework was available. Here is the command to be used to 164 # framework was available. Here is the command to be used to
137 # generate a proper archive: 165 # generate a proper archive:
148 # PostgreSQL 3.3 (framework pre-1.8.2) 176 # PostgreSQL 3.3 (framework pre-1.8.2)
149 set(ORTHANC_FRAMEWORK_MD5 "2d82bddf06f9cfe82095495cb3b8abde") 177 set(ORTHANC_FRAMEWORK_MD5 "2d82bddf06f9cfe82095495cb3b8abde")
150 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "23ad1b9c7800") 178 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "23ad1b9c7800")
151 # For "Toolbox::ReadJson()" and "Toolbox::Write{...}Json()" (pre-1.9.0) 179 # For "Toolbox::ReadJson()" and "Toolbox::Write{...}Json()" (pre-1.9.0)
152 set(ORTHANC_FRAMEWORK_MD5 "9af92080e57c60dd288eba46ce606c00") 180 set(ORTHANC_FRAMEWORK_MD5 "9af92080e57c60dd288eba46ce606c00")
181 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "b2e08d83e21d")
182 # WSI 1.1 (framework pre-1.10.0), to remove "-std=c++11"
183 set(ORTHANC_FRAMEWORK_MD5 "2eaa073cbb4b44ffba199ad93393b2b1")
184 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "daf4807631c5")
185 # DICOMweb 1.15 (framework pre-1.12.2)
186 set(ORTHANC_FRAMEWORK_MD5 "c644aff2817306b3207c98c92e43f35f")
153 endif() 187 endif()
154 endif() 188 endif()
155 endif() 189 endif()
156 190
157 elseif (ORTHANC_FRAMEWORK_SOURCE STREQUAL "path") 191 elseif (ORTHANC_FRAMEWORK_SOURCE STREQUAL "path")
284 if (DEFINED ORTHANC_FRAMEWORK_URL) 318 if (DEFINED ORTHANC_FRAMEWORK_URL)
285 string(REGEX REPLACE "^.*/" "" ORTHANC_FRAMEMORK_FILENAME "${ORTHANC_FRAMEWORK_URL}") 319 string(REGEX REPLACE "^.*/" "" ORTHANC_FRAMEMORK_FILENAME "${ORTHANC_FRAMEWORK_URL}")
286 else() 320 else()
287 # Default case: Download from the official Web site 321 # Default case: Download from the official Web site
288 set(ORTHANC_FRAMEMORK_FILENAME Orthanc-${ORTHANC_FRAMEWORK_VERSION}.tar.gz) 322 set(ORTHANC_FRAMEMORK_FILENAME Orthanc-${ORTHANC_FRAMEWORK_VERSION}.tar.gz)
289 set(ORTHANC_FRAMEWORK_URL "http://orthanc.osimis.io/ThirdPartyDownloads/orthanc-framework/${ORTHANC_FRAMEMORK_FILENAME}") 323 set(ORTHANC_FRAMEWORK_URL "https://orthanc.uclouvain.be/third-party-downloads/orthanc-framework/${ORTHANC_FRAMEMORK_FILENAME}")
290 endif() 324 endif()
291 325
292 set(ORTHANC_FRAMEWORK_ARCHIVE "${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${ORTHANC_FRAMEMORK_FILENAME}") 326 set(ORTHANC_FRAMEWORK_ARCHIVE "${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${ORTHANC_FRAMEMORK_FILENAME}")
293 327
294 if (NOT EXISTS "${ORTHANC_FRAMEWORK_ARCHIVE}") 328 if (NOT EXISTS "${ORTHANC_FRAMEWORK_ARCHIVE}")
490 CHECK_INCLUDE_FILE_CXX(${JSONCPP_INCLUDE_DIR}/json/reader.h HAVE_JSONCPP_H) 524 CHECK_INCLUDE_FILE_CXX(${JSONCPP_INCLUDE_DIR}/json/reader.h HAVE_JSONCPP_H)
491 if (NOT HAVE_JSONCPP_H) 525 if (NOT HAVE_JSONCPP_H)
492 message(FATAL_ERROR "Please install the libjsoncpp-dev package") 526 message(FATAL_ERROR "Please install the libjsoncpp-dev package")
493 endif() 527 endif()
494 528
495 # Switch to the C++11 standard if the version of JsonCpp is 1.y.z
496 # (same as variable JSONCPP_CXX11 in the source code of Orthanc)
497 if (EXISTS ${JSONCPP_INCLUDE_DIR}/json/version.h)
498 file(STRINGS
499 "${JSONCPP_INCLUDE_DIR}/json/version.h"
500 JSONCPP_VERSION_MAJOR1 REGEX
501 ".*define JSONCPP_VERSION_MAJOR.*")
502
503 if (NOT JSONCPP_VERSION_MAJOR1)
504 message(FATAL_ERROR "Unable to extract the major version of JsonCpp")
505 endif()
506
507 string(REGEX REPLACE
508 ".*JSONCPP_VERSION_MAJOR.*([0-9]+)$" "\\1"
509 JSONCPP_VERSION_MAJOR ${JSONCPP_VERSION_MAJOR1})
510 message("JsonCpp major version: ${JSONCPP_VERSION_MAJOR}")
511
512 if (JSONCPP_VERSION_MAJOR GREATER 0)
513 message("Switching to C++11 standard, as version of JsonCpp is >= 1.0.0")
514 if (CMAKE_COMPILER_IS_GNUCXX)
515 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
516 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
517 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
518 endif()
519 endif()
520 else()
521 message("Unable to detect the major version of JsonCpp, assuming < 1.0.0")
522 endif()
523
524 # Look for Orthanc framework shared library 529 # Look for Orthanc framework shared library
525 include(CheckCXXSymbolExists) 530 include(CheckCXXSymbolExists)
526 531
527 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") 532 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
528 set(ORTHANC_FRAMEWORK_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT}) 533 set(ORTHANC_FRAMEWORK_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT})