annotate OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake @ 4962:501411a67f10 more-tags

merge
author Alain Mazy <am@osimis.io>
date Wed, 23 Mar 2022 12:23:11 +0100
parents 1aea0b217f70
children c76eb3cedcf0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 # Orthanc - A Lightweight, RESTful DICOM Store
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 # Department, University Hospital of Liege, Belgium
4870
43e613a7756b upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4848
diff changeset
4 # Copyright (C) 2017-2022 Osimis S.A., Belgium
43e613a7756b upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4848
diff changeset
5 # Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 #
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 # This program is free software: you can redistribute it and/or
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4108
diff changeset
8 # modify it under the terms of the GNU Lesser General Public License
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4108
diff changeset
9 # as published by the Free Software Foundation, either version 3 of
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4108
diff changeset
10 # the License, or (at your option) any later version.
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 #
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful, but
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4108
diff changeset
15 # Lesser General Public License for more details.
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 #
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4108
diff changeset
17 # You should have received a copy of the GNU Lesser General Public
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4108
diff changeset
18 # License along with this program. If not, see
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4108
diff changeset
19 # <http://www.gnu.org/licenses/>.
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 ## Check whether the parent script sets the mandatory variables
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 if (NOT DEFINED ORTHANC_FRAMEWORK_SOURCE OR
4037
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
28 (NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "system" AND
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
29 NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg" AND
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "web" AND
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" AND
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "path"))
4037
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
33 message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_SOURCE must be set to \"system\", \"hg\", \"web\", \"archive\" or \"path\"")
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 ## Detection of the requested version
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg" OR
2533
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
42 ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" OR
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 ORTHANC_FRAMEWORK_SOURCE STREQUAL "web")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 if (NOT DEFINED ORTHANC_FRAMEWORK_VERSION)
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_VERSION must be set")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 if (DEFINED ORTHANC_FRAMEWORK_MAJOR OR
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 DEFINED ORTHANC_FRAMEWORK_MINOR OR
2533
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
50 DEFINED ORTHANC_FRAMEWORK_REVISION OR
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
51 DEFINED ORTHANC_FRAMEWORK_MD5)
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 message(FATAL_ERROR "Some internal variable has been set")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
2533
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
55 set(ORTHANC_FRAMEWORK_MD5 "")
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
56
2688
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
57 if (NOT DEFINED ORTHANC_FRAMEWORK_BRANCH)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
58 if (ORTHANC_FRAMEWORK_VERSION STREQUAL "mainline")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
59 set(ORTHANC_FRAMEWORK_BRANCH "default")
3407
b7728227a852 C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3318
diff changeset
60 set(ORTHANC_FRAMEWORK_MAJOR 999)
b7728227a852 C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3318
diff changeset
61 set(ORTHANC_FRAMEWORK_MINOR 999)
b7728227a852 C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3318
diff changeset
62 set(ORTHANC_FRAMEWORK_REVISION 999)
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
2688
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
64 else()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
65 set(ORTHANC_FRAMEWORK_BRANCH "Orthanc-${ORTHANC_FRAMEWORK_VERSION}")
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
2688
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
67 set(RE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
68 string(REGEX REPLACE ${RE} "\\1" ORTHANC_FRAMEWORK_MAJOR ${ORTHANC_FRAMEWORK_VERSION})
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
69 string(REGEX REPLACE ${RE} "\\2" ORTHANC_FRAMEWORK_MINOR ${ORTHANC_FRAMEWORK_VERSION})
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
70 string(REGEX REPLACE ${RE} "\\3" ORTHANC_FRAMEWORK_REVISION ${ORTHANC_FRAMEWORK_VERSION})
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
2688
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
72 if (NOT ORTHANC_FRAMEWORK_MAJOR MATCHES "^[0-9]+$" OR
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
73 NOT ORTHANC_FRAMEWORK_MINOR MATCHES "^[0-9]+$" OR
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
74 NOT ORTHANC_FRAMEWORK_REVISION MATCHES "^[0-9]+$")
4848
cab8d689a9a1 fix DownloadOrthancFramework.cmake for pre-releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4847
diff changeset
75 message("Bad version of the Orthanc framework, assuming a pre-release: ${ORTHANC_FRAMEWORK_VERSION}")
cab8d689a9a1 fix DownloadOrthancFramework.cmake for pre-releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4847
diff changeset
76 set(ORTHANC_FRAMEWORK_MAJOR 999)
cab8d689a9a1 fix DownloadOrthancFramework.cmake for pre-releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4847
diff changeset
77 set(ORTHANC_FRAMEWORK_MINOR 999)
cab8d689a9a1 fix DownloadOrthancFramework.cmake for pre-releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4847
diff changeset
78 set(ORTHANC_FRAMEWORK_REVISION 999)
2688
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
79 endif()
2533
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
80
2688
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
81 if (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.3.1")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
82 set(ORTHANC_FRAMEWORK_MD5 "dac95bd6cf86fb19deaf4e612961f378")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
83 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.3.2")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
84 set(ORTHANC_FRAMEWORK_MD5 "d0ccdf68e855d8224331f13774992750")
2740
e226f3a23f2f framework 1.4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2688
diff changeset
85 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.4.0")
e226f3a23f2f framework 1.4.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2688
diff changeset
86 set(ORTHANC_FRAMEWORK_MD5 "81e15f34d97ac32bbd7d26e85698835a")
2915
9abcfd97a76b Orthanc framework 1.4.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2838
diff changeset
87 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.4.1")
9abcfd97a76b Orthanc framework 1.4.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2838
diff changeset
88 set(ORTHANC_FRAMEWORK_MD5 "9b6f6114264b17ed421b574cd6476127")
2838
f3a2d109e361 new orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2740
diff changeset
89 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.4.2")
f3a2d109e361 new orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2740
diff changeset
90 set(ORTHANC_FRAMEWORK_MD5 "d1ee84927dcf668e60eb5868d24b9394")
2993
01dc71f9b9e3 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2915
diff changeset
91 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.0")
01dc71f9b9e3 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2915
diff changeset
92 set(ORTHANC_FRAMEWORK_MD5 "4429d8d9dea4ff6648df80ec3c64d79e")
3044
1000178f94e4 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2993
diff changeset
93 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.1")
1000178f94e4 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2993
diff changeset
94 set(ORTHANC_FRAMEWORK_MD5 "099671538865e5da96208b37494d6718")
3152
6150748578f6 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3135
diff changeset
95 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.2")
6150748578f6 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3135
diff changeset
96 set(ORTHANC_FRAMEWORK_MD5 "8867050f3e9a1ce6157c1ea7a9433b1b")
3170
04336d6da2c6 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3152
diff changeset
97 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.3")
04336d6da2c6 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3152
diff changeset
98 set(ORTHANC_FRAMEWORK_MD5 "bf2f5ed1adb8b0fc5f10d278e68e1dfe")
3213
abb204aed6bf back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3170
diff changeset
99 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.4")
abb204aed6bf back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3170
diff changeset
100 set(ORTHANC_FRAMEWORK_MD5 "404baef5d4c43e7c5d9410edda8ef5a5")
3307
66745b9039aa back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3213
diff changeset
101 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.5")
66745b9039aa back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3213
diff changeset
102 set(ORTHANC_FRAMEWORK_MD5 "cfc437e0687ae4bd725fd93dc1f08bc4")
3318
b770435a93d3 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3307
diff changeset
103 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.6")
b770435a93d3 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3307
diff changeset
104 set(ORTHANC_FRAMEWORK_MD5 "3c29de1e289b5472342947168f0105c0")
3450
bab2a84a6697 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3407
diff changeset
105 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.7")
bab2a84a6697 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3407
diff changeset
106 set(ORTHANC_FRAMEWORK_MD5 "e1b76f01116d9b5d4ac8cc39980560e3")
3542
25126912aa2c back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3450
diff changeset
107 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.8")
25126912aa2c back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3450
diff changeset
108 set(ORTHANC_FRAMEWORK_MD5 "82323e8c49a667f658a3639ea4dbc336")
3780
df69a5fdc836 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3717
diff changeset
109 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.6.0")
df69a5fdc836 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3717
diff changeset
110 set(ORTHANC_FRAMEWORK_MD5 "eab428d6e53f61e847fa360bb17ebe25")
3856
dd0fcbf6a791 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3853
diff changeset
111 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.6.1")
dd0fcbf6a791 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3853
diff changeset
112 set(ORTHANC_FRAMEWORK_MD5 "3971f5de96ba71dc9d3f3690afeaa7c0")
3969
170667f08642 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3856
diff changeset
113 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.0")
170667f08642 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3856
diff changeset
114 set(ORTHANC_FRAMEWORK_MD5 "ce5f689e852b01d3672bd3d2f952a5ef")
3983
7cd0fe733822 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3969
diff changeset
115 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.1")
7cd0fe733822 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3969
diff changeset
116 set(ORTHANC_FRAMEWORK_MD5 "3c171217f930abe80246997bdbcaf7cc")
4132
298216fce500 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4119
diff changeset
117 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.2")
298216fce500 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4119
diff changeset
118 set(ORTHANC_FRAMEWORK_MD5 "328f94dcbd78c169655a13f7ad58a2c2")
4160
77255a09883b back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4135
diff changeset
119 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.3")
4163
d0f9e29a751b fix md5 of Orthanc framework package
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4160
diff changeset
120 set(ORTHANC_FRAMEWORK_MD5 "3f1ba9502ec7c5449971d3b56087bcde")
4208
f659f79eb12a back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4163
diff changeset
121 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.4")
f659f79eb12a back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4163
diff changeset
122 set(ORTHANC_FRAMEWORK_MD5 "19fcb7c21876af86546baa048a22c6c0")
4255
2d6e7471ec7f back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4208
diff changeset
123 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.8.0")
2d6e7471ec7f back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4208
diff changeset
124 set(ORTHANC_FRAMEWORK_MD5 "f8ec7554ef5d23ea4ce474b1e8214de9")
4353
df15262373b0 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4336
diff changeset
125 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.8.1")
df15262373b0 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4336
diff changeset
126 set(ORTHANC_FRAMEWORK_MD5 "db094f96399cbe8b9bbdbce34884c220")
4388
558de9ecd107 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4372
diff changeset
127 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.8.2")
558de9ecd107 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4372
diff changeset
128 set(ORTHANC_FRAMEWORK_MD5 "8bfa10e66c9931e74111be0bfb1f4548")
4491
cf44052fdf60 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
129 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.0")
cf44052fdf60 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
130 set(ORTHANC_FRAMEWORK_MD5 "cea0b02ce184671eaf1bd668beefbf28")
4534
d9700b9f4ad9 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
131 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.1")
d9700b9f4ad9 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
132 set(ORTHANC_FRAMEWORK_MD5 "08eebc66ef93c3b40115c38501db5fbd")
4639
c638dd444de0 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4535
diff changeset
133 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.2")
c638dd444de0 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4535
diff changeset
134 set(ORTHANC_FRAMEWORK_MD5 "3ea66c09f64aca990016683b6375734e")
4659
38f5fb0885c4 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4639
diff changeset
135 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.3")
38f5fb0885c4 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4639
diff changeset
136 set(ORTHANC_FRAMEWORK_MD5 "9b86e6f00e03278293cd15643cc0233f")
4721
cf4a80a7e1a2 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4659
diff changeset
137 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.4")
cf4a80a7e1a2 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4659
diff changeset
138 set(ORTHANC_FRAMEWORK_MD5 "6d5ca4a73ac7d42445041ca79de1624d")
4746
0d57277aa54c back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4721
diff changeset
139 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.5")
0d57277aa54c back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4721
diff changeset
140 set(ORTHANC_FRAMEWORK_MD5 "10fc64de1254a095e5d3ed3931f0cfbb")
4759
cb18a1869e4e back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4746
diff changeset
141 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.6")
cb18a1869e4e back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4746
diff changeset
142 set(ORTHANC_FRAMEWORK_MD5 "4b5d05683d747c29b2860ad79d11e62e")
4784
113afe7b594d back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4759
diff changeset
143 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.7")
113afe7b594d back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4759
diff changeset
144 set(ORTHANC_FRAMEWORK_MD5 "c912bbb860d640d3ae3003b5c9698205")
4923
1aea0b217f70 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4902
diff changeset
145 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.10.0")
1aea0b217f70 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4902
diff changeset
146 set(ORTHANC_FRAMEWORK_MD5 "8610c82d9153f22e929f2110f8f60279")
3717
914f783ef085 development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
147
914f783ef085 development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
148 # Below this point are development snapshots that were used to
914f783ef085 development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
149 # release some plugin, before an official release of the Orthanc
914f783ef085 development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
150 # framework was available. Here is the command to be used to
914f783ef085 development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
151 # generate a proper archive:
914f783ef085 development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
152 #
914f783ef085 development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
153 # $ hg archive /tmp/Orthanc-`hg id -i | sed 's/\+//'`.tar.gz
914f783ef085 development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
154 #
914f783ef085 development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
155 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "ae0e3fd609df")
914f783ef085 development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
156 # DICOMweb 1.1 (framework pre-1.6.0)
914f783ef085 development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
157 set(ORTHANC_FRAMEWORK_MD5 "7e09e9b530a2f527854f0b782d7e0645")
4336
9b38aadd4a99 tagging pre-release of the Orthanc Framework for Stone Web viewer 1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4255
diff changeset
158 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "82652c5fc04f")
9b38aadd4a99 tagging pre-release of the Orthanc Framework for Stone Web viewer 1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4255
diff changeset
159 # Stone Web viewer 1.0 (framework pre-1.8.1)
9b38aadd4a99 tagging pre-release of the Orthanc Framework for Stone Web viewer 1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4255
diff changeset
160 set(ORTHANC_FRAMEWORK_MD5 "d77331d68917e66a3f4f9b807bbdab7f")
4372
bda867e036f3 tagging Orthanc framework 4a3ba4bf4ba7 for PostgreSQL 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4369
diff changeset
161 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "4a3ba4bf4ba7")
bda867e036f3 tagging Orthanc framework 4a3ba4bf4ba7 for PostgreSQL 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4369
diff changeset
162 # PostgreSQL 3.3 (framework pre-1.8.2)
bda867e036f3 tagging Orthanc framework 4a3ba4bf4ba7 for PostgreSQL 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4369
diff changeset
163 set(ORTHANC_FRAMEWORK_MD5 "2d82bddf06f9cfe82095495cb3b8abde")
4436
80a437bcc09b pre-release of Orthanc framework 23ad1b9c7800
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4388
diff changeset
164 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "23ad1b9c7800")
80a437bcc09b pre-release of Orthanc framework 23ad1b9c7800
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4388
diff changeset
165 # For "Toolbox::ReadJson()" and "Toolbox::Write{...}Json()" (pre-1.9.0)
80a437bcc09b pre-release of Orthanc framework 23ad1b9c7800
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4388
diff changeset
166 set(ORTHANC_FRAMEWORK_MD5 "9af92080e57c60dd288eba46ce606c00")
4847
5c4be6b10c11 fix tag for pre-release of the Orthanc framework for WSI 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4844
diff changeset
167 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "b2e08d83e21d")
4902
df86d2505df8 Orthanc 1.9.8 is now known as Orthanc 1.10.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4870
diff changeset
168 # WSI 1.1 (framework pre-1.10.0), to remove "-std=c++11"
4847
5c4be6b10c11 fix tag for pre-release of the Orthanc framework for WSI 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4844
diff changeset
169 set(ORTHANC_FRAMEWORK_MD5 "2eaa073cbb4b44ffba199ad93393b2b1")
2688
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2553
diff changeset
170 endif()
2533
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
171 endif()
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 endif()
4042
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
173
4135
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
174 elseif (ORTHANC_FRAMEWORK_SOURCE STREQUAL "path")
3407
b7728227a852 C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3318
diff changeset
175 message("Using the Orthanc framework from a path of the filesystem. Assuming mainline version.")
b7728227a852 C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3318
diff changeset
176 set(ORTHANC_FRAMEWORK_MAJOR 999)
b7728227a852 C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3318
diff changeset
177 set(ORTHANC_FRAMEWORK_MINOR 999)
b7728227a852 C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3318
diff changeset
178 set(ORTHANC_FRAMEWORK_REVISION 999)
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 ## Detection of the third-party software
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 find_program(ORTHANC_FRAMEWORK_HG hg)
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 if (${ORTHANC_FRAMEWORK_HG} MATCHES "ORTHANC_FRAMEWORK_HG-NOTFOUND")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 message(FATAL_ERROR "Please install Mercurial")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" OR
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 ORTHANC_FRAMEWORK_SOURCE STREQUAL "web")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 find_program(ORTHANC_FRAMEWORK_7ZIP 7z
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 PATHS
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 "$ENV{ProgramFiles}/7-Zip"
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 "$ENV{ProgramW6432}/7-Zip"
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 )
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 if (${ORTHANC_FRAMEWORK_7ZIP} MATCHES "ORTHANC_FRAMEWORK_7ZIP-NOTFOUND")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 message(FATAL_ERROR "Please install the '7-zip' software (http://www.7-zip.org/)")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 else()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 find_program(ORTHANC_FRAMEWORK_TAR tar)
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 if (${ORTHANC_FRAMEWORK_TAR} MATCHES "ORTHANC_FRAMEWORK_TAR-NOTFOUND")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 message(FATAL_ERROR "Please install the 'tar' package")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 ## Case of the Orthanc framework specified as a path on the filesystem
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "path")
4135
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
224 if (NOT DEFINED ORTHANC_FRAMEWORK_ROOT OR
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
225 ORTHANC_FRAMEWORK_ROOT STREQUAL "")
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_ROOT must provide the path to the sources of Orthanc")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT})
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 message(FATAL_ERROR "Non-existing directory: ${ORTHANC_FRAMEWORK_ROOT}")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 ## Case of the Orthanc framework cloned using Mercurial
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg")
2534
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2533
diff changeset
241 if (NOT STATIC_BUILD AND NOT ALLOW_DOWNLOADS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2533
diff changeset
242 message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2533
diff changeset
243 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2533
diff changeset
244
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 set(ORTHANC_ROOT ${CMAKE_BINARY_DIR}/orthanc)
2534
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2533
diff changeset
246
2537
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2534
diff changeset
247 if (EXISTS ${ORTHANC_ROOT})
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2534
diff changeset
248 message("Updating the Orthanc source repository using Mercurial")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2534
diff changeset
249 execute_process(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2534
diff changeset
250 COMMAND ${ORTHANC_FRAMEWORK_HG} pull
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2534
diff changeset
251 WORKING_DIRECTORY ${ORTHANC_ROOT}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2534
diff changeset
252 RESULT_VARIABLE Failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2534
diff changeset
253 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2534
diff changeset
254 else()
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 message("Forking the Orthanc source repository using Mercurial")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 execute_process(
3853
ba53d51ffa9a leaving bitbucket
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3780
diff changeset
257 COMMAND ${ORTHANC_FRAMEWORK_HG} clone "https://hg.orthanc-server.com/orthanc/"
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 RESULT_VARIABLE Failure
2537
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2534
diff changeset
260 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2534
diff changeset
261 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2534
diff changeset
262
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2534
diff changeset
263 if (Failure OR NOT EXISTS ${ORTHANC_ROOT})
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2534
diff changeset
264 message(FATAL_ERROR "Cannot fork the Orthanc repository")
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 message("Setting branch of the Orthanc repository to: ${ORTHANC_FRAMEWORK_BRANCH}")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 execute_process(
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 COMMAND ${ORTHANC_FRAMEWORK_HG} update -c ${ORTHANC_FRAMEWORK_BRANCH}
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 WORKING_DIRECTORY ${ORTHANC_ROOT}
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 RESULT_VARIABLE Failure
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 )
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 if (Failure)
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 message(FATAL_ERROR "Error while running Mercurial")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 ## Case of the Orthanc framework provided as a source archive on the
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 ## filesystem
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive")
4135
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
288 if (NOT DEFINED ORTHANC_FRAMEWORK_ARCHIVE OR
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
289 ORTHANC_FRAMEWORK_ARCHIVE STREQUAL "")
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_ARCHIVE must provide the path to the sources of Orthanc")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 ##
2547
8b6b0b6ece6b MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2537
diff changeset
297 ## Case of the Orthanc framework downloaded from the Web
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "web")
2547
8b6b0b6ece6b MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2537
diff changeset
301 if (DEFINED ORTHANC_FRAMEWORK_URL)
8b6b0b6ece6b MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2537
diff changeset
302 string(REGEX REPLACE "^.*/" "" ORTHANC_FRAMEMORK_FILENAME "${ORTHANC_FRAMEWORK_URL}")
8b6b0b6ece6b MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2537
diff changeset
303 else()
8b6b0b6ece6b MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2537
diff changeset
304 # Default case: Download from the official Web site
8b6b0b6ece6b MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2537
diff changeset
305 set(ORTHANC_FRAMEMORK_FILENAME Orthanc-${ORTHANC_FRAMEWORK_VERSION}.tar.gz)
3135
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
306 set(ORTHANC_FRAMEWORK_URL "http://orthanc.osimis.io/ThirdPartyDownloads/orthanc-framework/${ORTHANC_FRAMEMORK_FILENAME}")
2547
8b6b0b6ece6b MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2537
diff changeset
307 endif()
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 set(ORTHANC_FRAMEWORK_ARCHIVE "${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${ORTHANC_FRAMEMORK_FILENAME}")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311 if (NOT EXISTS "${ORTHANC_FRAMEWORK_ARCHIVE}")
2534
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2533
diff changeset
312 if (NOT STATIC_BUILD AND NOT ALLOW_DOWNLOADS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2533
diff changeset
313 message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2533
diff changeset
314 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2533
diff changeset
315
2547
8b6b0b6ece6b MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2537
diff changeset
316 message("Downloading: ${ORTHANC_FRAMEWORK_URL}")
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 file(DOWNLOAD
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319 "${ORTHANC_FRAMEWORK_URL}" "${ORTHANC_FRAMEWORK_ARCHIVE}"
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 SHOW_PROGRESS EXPECTED_MD5 "${ORTHANC_FRAMEWORK_MD5}"
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 TIMEOUT 60
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322 INACTIVITY_TIMEOUT 60
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323 )
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324 else()
2533
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
325 message("Using local copy of: ${ORTHANC_FRAMEWORK_URL}")
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
329
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
333 ## Uncompressing the Orthanc framework, if it was retrieved from a
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 ## source archive on the filesystem, or from the official Web site
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335 ##
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" OR
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 ORTHANC_FRAMEWORK_SOURCE STREQUAL "web")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340 if (NOT DEFINED ORTHANC_FRAMEWORK_ARCHIVE OR
2533
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
341 NOT DEFINED ORTHANC_FRAMEWORK_VERSION OR
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
342 NOT DEFINED ORTHANC_FRAMEWORK_MD5)
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 message(FATAL_ERROR "Internal error")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345
2533
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
346 if (ORTHANC_FRAMEWORK_MD5 STREQUAL "")
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
347 message(FATAL_ERROR "Unknown release of Orthanc: ${ORTHANC_FRAMEWORK_VERSION}")
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
348 endif()
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
349
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
350 file(MD5 ${ORTHANC_FRAMEWORK_ARCHIVE} ActualMD5)
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
351
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
352 if (NOT "${ActualMD5}" STREQUAL "${ORTHANC_FRAMEWORK_MD5}")
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
353 message(FATAL_ERROR "The MD5 hash of the Orthanc archive is invalid: ${ORTHANC_FRAMEWORK_ARCHIVE}")
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
354 endif()
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
355
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
356 set(ORTHANC_ROOT "${CMAKE_BINARY_DIR}/Orthanc-${ORTHANC_FRAMEWORK_VERSION}")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358 if (NOT IS_DIRECTORY "${ORTHANC_ROOT}")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359 if (NOT ORTHANC_FRAMEWORK_ARCHIVE MATCHES ".tar.gz$")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360 message(FATAL_ERROR "Archive should have the \".tar.gz\" extension: ${ORTHANC_FRAMEWORK_ARCHIVE}")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
361 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362
2533
e7f86a9f0f79 improvements
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2532
diff changeset
363 message("Uncompressing: ${ORTHANC_FRAMEWORK_ARCHIVE}")
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366 # How to silently extract files using 7-zip
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367 # http://superuser.com/questions/331148/7zip-command-line-extract-silently-quietly
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369 execute_process(
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370 COMMAND ${ORTHANC_FRAMEWORK_7ZIP} e -y ${ORTHANC_FRAMEWORK_ARCHIVE}
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
372 RESULT_VARIABLE Failure
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 OUTPUT_QUIET
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 )
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 if (Failure)
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377 message(FATAL_ERROR "Error while running the uncompression tool")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379
2553
7853c9a67605 fix for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2552
diff changeset
380 get_filename_component(TMP_FILENAME "${ORTHANC_FRAMEWORK_ARCHIVE}" NAME)
7853c9a67605 fix for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2552
diff changeset
381 string(REGEX REPLACE ".gz$" "" TMP_FILENAME2 "${TMP_FILENAME}")
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383 execute_process(
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384 COMMAND ${ORTHANC_FRAMEWORK_7ZIP} x -y ${TMP_FILENAME2}
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 RESULT_VARIABLE Failure
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 OUTPUT_QUIET
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 )
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 else()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 execute_process(
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392 COMMAND sh -c "${ORTHANC_FRAMEWORK_TAR} xfz ${ORTHANC_FRAMEWORK_ARCHIVE}"
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394 RESULT_VARIABLE Failure
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 )
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398 if (Failure)
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 message(FATAL_ERROR "Error while running the uncompression tool")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 if (NOT IS_DIRECTORY "${ORTHANC_ROOT}")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 message(FATAL_ERROR "The Orthanc framework was not uncompressed at the proper location. Check the CMake instructions.")
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 endif()
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405 endif()
4135
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
406 endif()
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
407
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
408
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
409
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
410 ##
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
411 ## Determine the path to the sources of the Orthanc framework
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
412 ##
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
413
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
414 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" OR
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
415 ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg" OR
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
416 ORTHANC_FRAMEWORK_SOURCE STREQUAL "web")
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
417 if (NOT DEFINED ORTHANC_ROOT OR
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
418 NOT DEFINED ORTHANC_FRAMEWORK_MAJOR OR
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
419 NOT DEFINED ORTHANC_FRAMEWORK_MINOR OR
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
420 NOT DEFINED ORTHANC_FRAMEWORK_REVISION)
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
421 message(FATAL_ERROR "Internal error in the DownloadOrthancFramework.cmake file")
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
422 endif()
4071
d6b7fb0f9652 improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
423
d6b7fb0f9652 improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
424 unset(ORTHANC_FRAMEWORK_ROOT CACHE)
d6b7fb0f9652 improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
425
4135
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
426 if ("${ORTHANC_FRAMEWORK_MAJOR}.${ORTHANC_FRAMEWORK_MINOR}.${ORTHANC_FRAMEWORK_REVISION}" VERSION_LESS "1.7.2")
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
427 set(ORTHANC_FRAMEWORK_ROOT "${ORTHANC_ROOT}/Core" CACHE
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
428 STRING "Path to the Orthanc framework source directory")
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
429 set(ENABLE_PLUGINS_VERSION_SCRIPT OFF)
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
430 else()
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
431 set(ORTHANC_FRAMEWORK_ROOT "${ORTHANC_ROOT}/OrthancFramework/Sources" CACHE
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
432 STRING "Path to the Orthanc framework source directory")
4071
d6b7fb0f9652 improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
433 endif()
d6b7fb0f9652 improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
434
d6b7fb0f9652 improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
435 unset(ORTHANC_ROOT)
2531
b7ed112ce56e DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436 endif()
4037
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
437
4135
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
438 if (NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
439 if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/OrthancException.h OR
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
440 NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake)
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
441 message(FATAL_ERROR "Directory not containing the source code of the Orthanc framework: ${ORTHANC_FRAMEWORK_ROOT}")
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
442 endif()
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
443 endif()
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
444
4037
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
445
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
446
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
447 ##
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
448 ## Case of the Orthanc framework installed as a shared library in a
4102
2ace6dc9b1d7 removed Google Test from DownloadOrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4097
diff changeset
449 ## GNU/Linux distribution (typically Debian). New in Orthanc 1.7.2.
4037
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
450 ##
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
451
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
452 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
453 set(ORTHANC_FRAMEWORK_LIBDIR "" CACHE PATH "")
4496
9ea70ccf0c21 Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4491
diff changeset
454 set(ORTHANC_FRAMEWORK_USE_SHARED ON CACHE BOOL "Whether to use the shared library or the static library")
4535
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
455 set(ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES "" CACHE STRING "Additional libraries to link against, separated by whitespaces, typically needed if using the static library (a common minimal value is \"boost_filesystem boost_iostreams boost_locale boost_regex boost_thread jsoncpp pugixml uuid\")")
4037
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
456
4042
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
457 if (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
458 CMAKE_COMPILER_IS_GNUCXX) # MinGW
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
459 set(DYNAMIC_MINGW_STDLIB ON) # Disable static linking against libc (to throw exceptions)
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
460 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++")
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
461 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
462 endif()
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
463
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
464 include(CheckIncludeFile)
4037
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
465 include(CheckIncludeFileCXX)
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
466 include(FindPythonInterp)
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
467 include(${CMAKE_CURRENT_LIST_DIR}/Compiler.cmake)
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
468 include(${CMAKE_CURRENT_LIST_DIR}/DownloadPackage.cmake)
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
469 include(${CMAKE_CURRENT_LIST_DIR}/AutoGeneratedCode.cmake)
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
470 set(EMBED_RESOURCES_PYTHON ${CMAKE_CURRENT_LIST_DIR}/EmbedResources.py)
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
471
4535
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
472 if (ORTHANC_FRAMEWORK_USE_SHARED)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
473 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
474 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
475 else()
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
476 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
477 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 1 Suffix)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
478 endif()
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
479
4496
9ea70ccf0c21 Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4491
diff changeset
480 # The "OrthancFramework" library must be the first one to be included
9ea70ccf0c21 Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4491
diff changeset
481 if ("${ORTHANC_FRAMEWORK_LIBDIR}" STREQUAL "")
4535
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
482 set(ORTHANC_FRAMEWORK_LIBRARIES ${Prefix}OrthancFramework${Suffix})
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
483 else ()
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
484 set(ORTHANC_FRAMEWORK_LIBRARIES ${ORTHANC_FRAMEWORK_LIBDIR}/${Prefix}OrthancFramework${Suffix})
4496
9ea70ccf0c21 Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4491
diff changeset
485 endif()
9ea70ccf0c21 Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4491
diff changeset
486
4531
d64e6f401a8a additional option in DownloadOrthancFramework: ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4530
diff changeset
487 if (NOT ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES STREQUAL "")
d64e6f401a8a additional option in DownloadOrthancFramework: ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4530
diff changeset
488 # https://stackoverflow.com/a/5272993/881731
d64e6f401a8a additional option in DownloadOrthancFramework: ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4530
diff changeset
489 string(REPLACE " " ";" tmp ${ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES})
d64e6f401a8a additional option in DownloadOrthancFramework: ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4530
diff changeset
490 list(APPEND ORTHANC_FRAMEWORK_LIBRARIES ${tmp})
d64e6f401a8a additional option in DownloadOrthancFramework: ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4530
diff changeset
491 endif()
d64e6f401a8a additional option in DownloadOrthancFramework: ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4530
diff changeset
492
4535
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
493 # Look for the version of the mandatory dependency JsonCpp (cf. JsonCppConfiguration.cmake)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
494 if (CMAKE_CROSSCOMPILING)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
495 set(JSONCPP_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT}/..)
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
496 else()
4042
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
497 find_path(JSONCPP_INCLUDE_DIR json/reader.h
4535
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
498 ${ORTHANC_FRAMEWORK_ROOT}/..
4042
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
499 /usr/include/jsoncpp
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
500 /usr/local/include/jsoncpp
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
501 )
4535
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
502 endif()
4042
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
503
4535
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
504 message("JsonCpp include dir: ${JSONCPP_INCLUDE_DIR}")
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
505 include_directories(${JSONCPP_INCLUDE_DIR})
4042
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
506
4535
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
507 CHECK_INCLUDE_FILE_CXX(${JSONCPP_INCLUDE_DIR}/json/reader.h HAVE_JSONCPP_H)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
508 if (NOT HAVE_JSONCPP_H)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
509 message(FATAL_ERROR "Please install the libjsoncpp-dev package")
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
510 endif()
4135
baf8e21e91cb improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4132
diff changeset
511
4037
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
512 # Look for Orthanc framework shared library
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
513 include(CheckCXXSymbolExists)
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
514
4042
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
515 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
516 set(ORTHANC_FRAMEWORK_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT})
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
517 else()
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
518 find_path(ORTHANC_FRAMEWORK_INCLUDE_DIR OrthancFramework.h
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
519 /usr/include/orthanc-framework
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
520 /usr/local/include/orthanc-framework
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
521 ${ORTHANC_FRAMEWORK_ROOT}
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
522 )
f5c86a00cae0 moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4037
diff changeset
523 endif()
4097
99e2054d1e8d fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
524
99e2054d1e8d fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
525 if (${ORTHANC_FRAMEWORK_INCLUDE_DIR} STREQUAL "ORTHANC_FRAMEWORK_INCLUDE_DIR-NOTFOUND")
99e2054d1e8d fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
526 message(FATAL_ERROR "Cannot locate the OrthancFramework.h header")
99e2054d1e8d fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4071
diff changeset
527 endif()
4037
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
528
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
529 message("Orthanc framework include dir: ${ORTHANC_FRAMEWORK_INCLUDE_DIR}")
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
530 include_directories(${ORTHANC_FRAMEWORK_INCLUDE_DIR})
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
531
4535
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
532 if (ORTHANC_FRAMEWORK_USE_SHARED)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
533 set(CMAKE_REQUIRED_INCLUDES "${ORTHANC_FRAMEWORK_INCLUDE_DIR}")
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
534 set(CMAKE_REQUIRED_LIBRARIES "${ORTHANC_FRAMEWORK_LIBRARIES}")
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
535
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
536 check_cxx_symbol_exists("Orthanc::InitializeFramework" "OrthancFramework.h" HAVE_ORTHANC_FRAMEWORK)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
537 if (NOT HAVE_ORTHANC_FRAMEWORK)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
538 message(FATAL_ERROR "Cannot find the Orthanc framework")
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
539 endif()
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
540
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
541 unset(CMAKE_REQUIRED_INCLUDES)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4534
diff changeset
542 unset(CMAKE_REQUIRED_LIBRARIES)
4037
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
543 endif()
5e26d004838c adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3983
diff changeset
544 endif()