Mercurial > hg > orthanc-stone
annotate OrthancStone/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake @ 2124:16c01cc201e7
updated copyright, as Osimis is not active on Orthanc anymore
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 30 May 2024 17:00:29 +0200 |
parents | 15f11bb8de32 |
children | 2965172977a4 |
rev | line source |
---|---|
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 # Orthanc - A Lightweight, RESTful DICOM Store |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
2114
c23eef785569
update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2108
diff
changeset
|
4 # Copyright (C) 2017-2024 Osimis S.A., Belgium |
c23eef785569
update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2108
diff
changeset
|
5 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 # |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 # This program is free software: you can redistribute it and/or |
1514 | 8 # modify it under the terms of the GNU Lesser General Public License |
9 # as published by the Free Software Foundation, either version 3 of | |
10 # the License, or (at your option) any later version. | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 # |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 # This program is distributed in the hope that it will be useful, but |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 # WITHOUT ANY WARRANTY; without even the implied warranty of |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1514 | 15 # Lesser General Public License for more details. |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 # |
1514 | 17 # You should have received a copy of the GNU Lesser General Public |
18 # License along with this program. If not, see | |
19 # <http://www.gnu.org/licenses/>. | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 ## Check whether the parent script sets the mandatory variables |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 if (NOT DEFINED ORTHANC_FRAMEWORK_SOURCE OR |
1499 | 28 (NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "system" AND |
29 NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg" AND | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "web" AND |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" AND |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "path")) |
1499 | 33 message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_SOURCE must be set to \"system\", \"hg\", \"web\", \"archive\" or \"path\"") |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 ## Detection of the requested version |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg" OR |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" OR |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 ORTHANC_FRAMEWORK_SOURCE STREQUAL "web") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 if (NOT DEFINED ORTHANC_FRAMEWORK_VERSION) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_VERSION must be set") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 if (DEFINED ORTHANC_FRAMEWORK_MAJOR OR |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 DEFINED ORTHANC_FRAMEWORK_MINOR OR |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 DEFINED ORTHANC_FRAMEWORK_REVISION OR |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 DEFINED ORTHANC_FRAMEWORK_MD5) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 message(FATAL_ERROR "Some internal variable has been set") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 set(ORTHANC_FRAMEWORK_MD5 "") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 |
310 | 57 if (NOT DEFINED ORTHANC_FRAMEWORK_BRANCH) |
58 if (ORTHANC_FRAMEWORK_VERSION STREQUAL "mainline") | |
59 set(ORTHANC_FRAMEWORK_BRANCH "default") | |
1268 | 60 set(ORTHANC_FRAMEWORK_MAJOR 999) |
61 set(ORTHANC_FRAMEWORK_MINOR 999) | |
62 set(ORTHANC_FRAMEWORK_REVISION 999) | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 |
310 | 64 else() |
65 set(ORTHANC_FRAMEWORK_BRANCH "Orthanc-${ORTHANC_FRAMEWORK_VERSION}") | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 |
310 | 67 set(RE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$") |
68 string(REGEX REPLACE ${RE} "\\1" ORTHANC_FRAMEWORK_MAJOR ${ORTHANC_FRAMEWORK_VERSION}) | |
69 string(REGEX REPLACE ${RE} "\\2" ORTHANC_FRAMEWORK_MINOR ${ORTHANC_FRAMEWORK_VERSION}) | |
70 string(REGEX REPLACE ${RE} "\\3" ORTHANC_FRAMEWORK_REVISION ${ORTHANC_FRAMEWORK_VERSION}) | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 |
310 | 72 if (NOT ORTHANC_FRAMEWORK_MAJOR MATCHES "^[0-9]+$" OR |
73 NOT ORTHANC_FRAMEWORK_MINOR MATCHES "^[0-9]+$" OR | |
74 NOT ORTHANC_FRAMEWORK_REVISION MATCHES "^[0-9]+$") | |
1869 | 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) | |
310 | 79 endif() |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 |
310 | 81 if (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.3.1") |
82 set(ORTHANC_FRAMEWORK_MD5 "dac95bd6cf86fb19deaf4e612961f378") | |
83 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.3.2") | |
84 set(ORTHANC_FRAMEWORK_MD5 "d0ccdf68e855d8224331f13774992750") | |
85 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.4.0") | |
86 set(ORTHANC_FRAMEWORK_MD5 "81e15f34d97ac32bbd7d26e85698835a") | |
369 | 87 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.4.1") |
88 set(ORTHANC_FRAMEWORK_MD5 "9b6f6114264b17ed421b574cd6476127") | |
310 | 89 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.4.2") |
90 set(ORTHANC_FRAMEWORK_MD5 "d1ee84927dcf668e60eb5868d24b9394") | |
439 | 91 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.0") |
92 set(ORTHANC_FRAMEWORK_MD5 "4429d8d9dea4ff6648df80ec3c64d79e") | |
93 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.1") | |
94 set(ORTHANC_FRAMEWORK_MD5 "099671538865e5da96208b37494d6718") | |
569 | 95 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.2") |
96 set(ORTHANC_FRAMEWORK_MD5 "8867050f3e9a1ce6157c1ea7a9433b1b") | |
97 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.3") | |
98 set(ORTHANC_FRAMEWORK_MD5 "bf2f5ed1adb8b0fc5f10d278e68e1dfe") | |
99 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.4") | |
100 set(ORTHANC_FRAMEWORK_MD5 "404baef5d4c43e7c5d9410edda8ef5a5") | |
101 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.5") | |
102 set(ORTHANC_FRAMEWORK_MD5 "cfc437e0687ae4bd725fd93dc1f08bc4") | |
103 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.6") | |
104 set(ORTHANC_FRAMEWORK_MD5 "3c29de1e289b5472342947168f0105c0") | |
1268 | 105 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.7") |
106 set(ORTHANC_FRAMEWORK_MD5 "e1b76f01116d9b5d4ac8cc39980560e3") | |
107 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.8") | |
108 set(ORTHANC_FRAMEWORK_MD5 "82323e8c49a667f658a3639ea4dbc336") | |
1456 | 109 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.6.0") |
110 set(ORTHANC_FRAMEWORK_MD5 "eab428d6e53f61e847fa360bb17ebe25") | |
1499 | 111 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.6.1") |
112 set(ORTHANC_FRAMEWORK_MD5 "3971f5de96ba71dc9d3f3690afeaa7c0") | |
113 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.0") | |
114 set(ORTHANC_FRAMEWORK_MD5 "ce5f689e852b01d3672bd3d2f952a5ef") | |
115 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.1") | |
116 set(ORTHANC_FRAMEWORK_MD5 "3c171217f930abe80246997bdbcaf7cc") | |
1530 | 117 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.2") |
118 set(ORTHANC_FRAMEWORK_MD5 "328f94dcbd78c169655a13f7ad58a2c2") | |
1588 | 119 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.3") |
120 set(ORTHANC_FRAMEWORK_MD5 "3f1ba9502ec7c5449971d3b56087bcde") | |
121 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.4") | |
122 set(ORTHANC_FRAMEWORK_MD5 "19fcb7c21876af86546baa048a22c6c0") | |
123 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.8.0") | |
124 set(ORTHANC_FRAMEWORK_MD5 "f8ec7554ef5d23ea4ce474b1e8214de9") | |
1736 | 125 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.8.1") |
126 set(ORTHANC_FRAMEWORK_MD5 "db094f96399cbe8b9bbdbce34884c220") | |
127 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.8.2") | |
128 set(ORTHANC_FRAMEWORK_MD5 "8bfa10e66c9931e74111be0bfb1f4548") | |
1810 | 129 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.0") |
130 set(ORTHANC_FRAMEWORK_MD5 "cea0b02ce184671eaf1bd668beefbf28") | |
131 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.1") | |
132 set(ORTHANC_FRAMEWORK_MD5 "08eebc66ef93c3b40115c38501db5fbd") | |
133 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.2") | |
134 set(ORTHANC_FRAMEWORK_MD5 "3ea66c09f64aca990016683b6375734e") | |
135 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.3") | |
136 set(ORTHANC_FRAMEWORK_MD5 "9b86e6f00e03278293cd15643cc0233f") | |
1841 | 137 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.4") |
138 set(ORTHANC_FRAMEWORK_MD5 "6d5ca4a73ac7d42445041ca79de1624d") | |
1856
0830db74be6b
StoneWebViewer-2.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1841
diff
changeset
|
139 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.5") |
0830db74be6b
StoneWebViewer-2.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1841
diff
changeset
|
140 set(ORTHANC_FRAMEWORK_MD5 "10fc64de1254a095e5d3ed3931f0cfbb") |
0830db74be6b
StoneWebViewer-2.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1841
diff
changeset
|
141 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.6") |
0830db74be6b
StoneWebViewer-2.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1841
diff
changeset
|
142 set(ORTHANC_FRAMEWORK_MD5 "4b5d05683d747c29b2860ad79d11e62e") |
0830db74be6b
StoneWebViewer-2.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1841
diff
changeset
|
143 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.7") |
0830db74be6b
StoneWebViewer-2.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1841
diff
changeset
|
144 set(ORTHANC_FRAMEWORK_MD5 "c912bbb860d640d3ae3003b5c9698205") |
1913 | 145 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.10.0") |
146 set(ORTHANC_FRAMEWORK_MD5 "8610c82d9153f22e929f2110f8f60279") | |
1927 | 147 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.10.1") |
148 set(ORTHANC_FRAMEWORK_MD5 "caf667fc5ea452b3d0c2f70bfd02599c") | |
1955 | 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") | |
2077
07964689cb0b
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1955
diff
changeset
|
155 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.11.3") |
2124
16c01cc201e7
updated copyright, as Osimis is not active on Orthanc anymore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2116
diff
changeset
|
156 set(ORTHANC_FRAMEWORK_MD5 "e48fc0cb09c4856803791a1be28c07dc") |
2077
07964689cb0b
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1955
diff
changeset
|
157 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.12.0") |
07964689cb0b
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1955
diff
changeset
|
158 set(ORTHANC_FRAMEWORK_MD5 "d32a0cde03b6eb603d8dd2b33d38bf1b") |
07964689cb0b
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1955
diff
changeset
|
159 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.12.1") |
07964689cb0b
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1955
diff
changeset
|
160 set(ORTHANC_FRAMEWORK_MD5 "8a435140efc8ff4a01d8242f092f21de") |
2114
c23eef785569
update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2108
diff
changeset
|
161 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.12.2") |
c23eef785569
update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2108
diff
changeset
|
162 set(ORTHANC_FRAMEWORK_MD5 "d2476b9e796e339ac320b5333489bdb3") |
2116 | 163 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.12.3") |
164 set(ORTHANC_FRAMEWORK_MD5 "975f5bf2142c22cb1777b4f6a0a614c5") | |
1456 | 165 |
166 # Below this point are development snapshots that were used to | |
167 # release some plugin, before an official release of the Orthanc | |
168 # framework was available. Here is the command to be used to | |
169 # generate a proper archive: | |
170 # | |
171 # $ hg archive /tmp/Orthanc-`hg id -i | sed 's/\+//'`.tar.gz | |
172 # | |
173 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "ae0e3fd609df") | |
174 # DICOMweb 1.1 (framework pre-1.6.0) | |
2104
5653b6335642
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2101
diff
changeset
|
175 set(ORTHANC_FRAMEWORK_PRE_RELEASE ON) |
1456 | 176 set(ORTHANC_FRAMEWORK_MD5 "7e09e9b530a2f527854f0b782d7e0645") |
1730
af4a2d08549c
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
177 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "82652c5fc04f") |
af4a2d08549c
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
178 # Stone Web viewer 1.0 (framework pre-1.8.1) |
2104
5653b6335642
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2101
diff
changeset
|
179 set(ORTHANC_FRAMEWORK_PRE_RELEASE ON) |
1730
af4a2d08549c
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
180 set(ORTHANC_FRAMEWORK_MD5 "d77331d68917e66a3f4f9b807bbdab7f") |
1736 | 181 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "4a3ba4bf4ba7") |
182 # PostgreSQL 3.3 (framework pre-1.8.2) | |
2104
5653b6335642
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2101
diff
changeset
|
183 set(ORTHANC_FRAMEWORK_PRE_RELEASE ON) |
1736 | 184 set(ORTHANC_FRAMEWORK_MD5 "2d82bddf06f9cfe82095495cb3b8abde") |
1739
9ac2a65d4172
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1736
diff
changeset
|
185 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "23ad1b9c7800") |
9ac2a65d4172
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1736
diff
changeset
|
186 # For "Toolbox::ReadJson()" and "Toolbox::Write{...}Json()" (pre-1.9.0) |
2104
5653b6335642
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2101
diff
changeset
|
187 set(ORTHANC_FRAMEWORK_PRE_RELEASE ON) |
1739
9ac2a65d4172
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1736
diff
changeset
|
188 set(ORTHANC_FRAMEWORK_MD5 "9af92080e57c60dd288eba46ce606c00") |
1869 | 189 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "b2e08d83e21d") |
1913 | 190 # WSI 1.1 (framework pre-1.10.0), to remove "-std=c++11" |
2104
5653b6335642
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2101
diff
changeset
|
191 set(ORTHANC_FRAMEWORK_PRE_RELEASE ON) |
1869 | 192 set(ORTHANC_FRAMEWORK_MD5 "2eaa073cbb4b44ffba199ad93393b2b1") |
2081
3ef91da06636
fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
193 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "daf4807631c5") |
3ef91da06636
fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
194 # DICOMweb 1.15 (framework pre-1.12.2) |
2104
5653b6335642
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2101
diff
changeset
|
195 set(ORTHANC_FRAMEWORK_PRE_RELEASE ON) |
2108 | 196 set(ORTHANC_FRAMEWORK_MD5 "ebe8bdf388319f1c9536b2b680451848") |
310 | 197 endif() |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
198 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
199 endif() |
1499 | 200 |
1530 | 201 elseif (ORTHANC_FRAMEWORK_SOURCE STREQUAL "path") |
1268 | 202 message("Using the Orthanc framework from a path of the filesystem. Assuming mainline version.") |
203 set(ORTHANC_FRAMEWORK_MAJOR 999) | |
204 set(ORTHANC_FRAMEWORK_MINOR 999) | |
205 set(ORTHANC_FRAMEWORK_REVISION 999) | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
206 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
207 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
208 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
209 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
210 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
211 ## Detection of the third-party software |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
212 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
213 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
214 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
215 find_program(ORTHANC_FRAMEWORK_HG hg) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
216 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
217 if (${ORTHANC_FRAMEWORK_HG} MATCHES "ORTHANC_FRAMEWORK_HG-NOTFOUND") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
218 message(FATAL_ERROR "Please install Mercurial") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
219 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
220 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
221 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
222 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
223 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" OR |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
224 ORTHANC_FRAMEWORK_SOURCE STREQUAL "web") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
225 if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
226 find_program(ORTHANC_FRAMEWORK_7ZIP 7z |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
227 PATHS |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
228 "$ENV{ProgramFiles}/7-Zip" |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
229 "$ENV{ProgramW6432}/7-Zip" |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
230 ) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
231 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
232 if (${ORTHANC_FRAMEWORK_7ZIP} MATCHES "ORTHANC_FRAMEWORK_7ZIP-NOTFOUND") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
233 message(FATAL_ERROR "Please install the '7-zip' software (http://www.7-zip.org/)") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
234 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
235 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
236 else() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
237 find_program(ORTHANC_FRAMEWORK_TAR tar) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
238 if (${ORTHANC_FRAMEWORK_TAR} MATCHES "ORTHANC_FRAMEWORK_TAR-NOTFOUND") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
239 message(FATAL_ERROR "Please install the 'tar' package") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
240 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
241 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
242 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
243 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
244 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
245 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
246 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
247 ## Case of the Orthanc framework specified as a path on the filesystem |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
248 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
249 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
250 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "path") |
1530 | 251 if (NOT DEFINED ORTHANC_FRAMEWORK_ROOT OR |
252 ORTHANC_FRAMEWORK_ROOT STREQUAL "") | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
253 message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_ROOT must provide the path to the sources of Orthanc") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
254 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
255 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
256 if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
257 message(FATAL_ERROR "Non-existing directory: ${ORTHANC_FRAMEWORK_ROOT}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
258 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
259 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
260 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
261 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
262 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
263 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
264 ## Case of the Orthanc framework cloned using Mercurial |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
265 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
266 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
267 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
268 if (NOT STATIC_BUILD AND NOT ALLOW_DOWNLOADS) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
269 message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
270 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
271 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
272 set(ORTHANC_ROOT ${CMAKE_BINARY_DIR}/orthanc) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
273 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
274 if (EXISTS ${ORTHANC_ROOT}) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
275 message("Updating the Orthanc source repository using Mercurial") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
276 execute_process( |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
277 COMMAND ${ORTHANC_FRAMEWORK_HG} pull |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
278 WORKING_DIRECTORY ${ORTHANC_ROOT} |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
279 RESULT_VARIABLE Failure |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
280 ) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
281 else() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
282 message("Forking the Orthanc source repository using Mercurial") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
283 execute_process( |
2101 | 284 COMMAND ${ORTHANC_FRAMEWORK_HG} clone "https://orthanc.uclouvain.be/hg/orthanc/" |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
285 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
286 RESULT_VARIABLE Failure |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
287 ) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
288 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
289 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
290 if (Failure OR NOT EXISTS ${ORTHANC_ROOT}) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
291 message(FATAL_ERROR "Cannot fork the Orthanc repository") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
292 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
293 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
294 message("Setting branch of the Orthanc repository to: ${ORTHANC_FRAMEWORK_BRANCH}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
295 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
296 execute_process( |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
297 COMMAND ${ORTHANC_FRAMEWORK_HG} update -c ${ORTHANC_FRAMEWORK_BRANCH} |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
298 WORKING_DIRECTORY ${ORTHANC_ROOT} |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
299 RESULT_VARIABLE Failure |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
300 ) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
301 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
302 if (Failure) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
303 message(FATAL_ERROR "Error while running Mercurial") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
304 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
305 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
306 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
307 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
308 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
309 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
310 ## Case of the Orthanc framework provided as a source archive on the |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
311 ## filesystem |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
312 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
313 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
314 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive") |
1530 | 315 if (NOT DEFINED ORTHANC_FRAMEWORK_ARCHIVE OR |
316 ORTHANC_FRAMEWORK_ARCHIVE STREQUAL "") | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
317 message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_ARCHIVE must provide the path to the sources of Orthanc") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
318 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
319 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
320 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
321 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
322 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
323 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
324 ## Case of the Orthanc framework downloaded from the Web |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
325 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
326 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
327 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "web") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
328 if (DEFINED ORTHANC_FRAMEWORK_URL) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
329 string(REGEX REPLACE "^.*/" "" ORTHANC_FRAMEMORK_FILENAME "${ORTHANC_FRAMEWORK_URL}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
330 else() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
331 # Default case: Download from the official Web site |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
332 set(ORTHANC_FRAMEMORK_FILENAME Orthanc-${ORTHANC_FRAMEWORK_VERSION}.tar.gz) |
2104
5653b6335642
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2101
diff
changeset
|
333 if (ORTHANC_FRAMEWORK_PRE_RELEASE) |
5653b6335642
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2101
diff
changeset
|
334 set(ORTHANC_FRAMEWORK_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/orthanc-framework/${ORTHANC_FRAMEMORK_FILENAME}") |
5653b6335642
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2101
diff
changeset
|
335 else() |
5653b6335642
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2101
diff
changeset
|
336 set(ORTHANC_FRAMEWORK_URL "https://orthanc.uclouvain.be/downloads/sources/orthanc/${ORTHANC_FRAMEMORK_FILENAME}") |
5653b6335642
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2101
diff
changeset
|
337 endif() |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
338 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
339 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
340 set(ORTHANC_FRAMEWORK_ARCHIVE "${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${ORTHANC_FRAMEMORK_FILENAME}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
341 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
342 if (NOT EXISTS "${ORTHANC_FRAMEWORK_ARCHIVE}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
343 if (NOT STATIC_BUILD AND NOT ALLOW_DOWNLOADS) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
344 message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
345 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
346 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
347 message("Downloading: ${ORTHANC_FRAMEWORK_URL}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
348 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
349 file(DOWNLOAD |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
350 "${ORTHANC_FRAMEWORK_URL}" "${ORTHANC_FRAMEWORK_ARCHIVE}" |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
351 SHOW_PROGRESS EXPECTED_MD5 "${ORTHANC_FRAMEWORK_MD5}" |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
352 TIMEOUT 60 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
353 INACTIVITY_TIMEOUT 60 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
354 ) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
355 else() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
356 message("Using local copy of: ${ORTHANC_FRAMEWORK_URL}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
357 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
358 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
359 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
360 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
361 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
362 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
363 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
364 ## Uncompressing the Orthanc framework, if it was retrieved from a |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
365 ## source archive on the filesystem, or from the official Web site |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
366 ## |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
367 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
368 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" OR |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
369 ORTHANC_FRAMEWORK_SOURCE STREQUAL "web") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
370 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
371 if (NOT DEFINED ORTHANC_FRAMEWORK_ARCHIVE OR |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
372 NOT DEFINED ORTHANC_FRAMEWORK_VERSION OR |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
373 NOT DEFINED ORTHANC_FRAMEWORK_MD5) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
374 message(FATAL_ERROR "Internal error") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
375 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
376 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
377 if (ORTHANC_FRAMEWORK_MD5 STREQUAL "") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
378 message(FATAL_ERROR "Unknown release of Orthanc: ${ORTHANC_FRAMEWORK_VERSION}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
379 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
380 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
381 file(MD5 ${ORTHANC_FRAMEWORK_ARCHIVE} ActualMD5) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
382 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
383 if (NOT "${ActualMD5}" STREQUAL "${ORTHANC_FRAMEWORK_MD5}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
384 message(FATAL_ERROR "The MD5 hash of the Orthanc archive is invalid: ${ORTHANC_FRAMEWORK_ARCHIVE}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
385 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
386 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
387 set(ORTHANC_ROOT "${CMAKE_BINARY_DIR}/Orthanc-${ORTHANC_FRAMEWORK_VERSION}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
388 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
389 if (NOT IS_DIRECTORY "${ORTHANC_ROOT}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
390 if (NOT ORTHANC_FRAMEWORK_ARCHIVE MATCHES ".tar.gz$") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
391 message(FATAL_ERROR "Archive should have the \".tar.gz\" extension: ${ORTHANC_FRAMEWORK_ARCHIVE}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
392 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
393 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
394 message("Uncompressing: ${ORTHANC_FRAMEWORK_ARCHIVE}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
395 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
396 if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
397 # How to silently extract files using 7-zip |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
398 # http://superuser.com/questions/331148/7zip-command-line-extract-silently-quietly |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
399 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
400 execute_process( |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
401 COMMAND ${ORTHANC_FRAMEWORK_7ZIP} e -y ${ORTHANC_FRAMEWORK_ARCHIVE} |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
402 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
403 RESULT_VARIABLE Failure |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
404 OUTPUT_QUIET |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
405 ) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
406 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
407 if (Failure) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
408 message(FATAL_ERROR "Error while running the uncompression tool") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
409 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
410 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
411 get_filename_component(TMP_FILENAME "${ORTHANC_FRAMEWORK_ARCHIVE}" NAME) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
412 string(REGEX REPLACE ".gz$" "" TMP_FILENAME2 "${TMP_FILENAME}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
413 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
414 execute_process( |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
415 COMMAND ${ORTHANC_FRAMEWORK_7ZIP} x -y ${TMP_FILENAME2} |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
416 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
417 RESULT_VARIABLE Failure |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
418 OUTPUT_QUIET |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
419 ) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
420 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
421 else() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
422 execute_process( |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
423 COMMAND sh -c "${ORTHANC_FRAMEWORK_TAR} xfz ${ORTHANC_FRAMEWORK_ARCHIVE}" |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
424 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
425 RESULT_VARIABLE Failure |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
426 ) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
427 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
428 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
429 if (Failure) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
430 message(FATAL_ERROR "Error while running the uncompression tool") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
431 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
432 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
433 if (NOT IS_DIRECTORY "${ORTHANC_ROOT}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
434 message(FATAL_ERROR "The Orthanc framework was not uncompressed at the proper location. Check the CMake instructions.") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
435 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
436 endif() |
1530 | 437 endif() |
438 | |
439 | |
440 | |
441 ## | |
442 ## Determine the path to the sources of the Orthanc framework | |
443 ## | |
444 | |
445 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" OR | |
446 ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg" OR | |
447 ORTHANC_FRAMEWORK_SOURCE STREQUAL "web") | |
448 if (NOT DEFINED ORTHANC_ROOT OR | |
449 NOT DEFINED ORTHANC_FRAMEWORK_MAJOR OR | |
450 NOT DEFINED ORTHANC_FRAMEWORK_MINOR OR | |
451 NOT DEFINED ORTHANC_FRAMEWORK_REVISION) | |
452 message(FATAL_ERROR "Internal error in the DownloadOrthancFramework.cmake file") | |
453 endif() | |
1504 | 454 |
455 unset(ORTHANC_FRAMEWORK_ROOT CACHE) | |
456 | |
1530 | 457 if ("${ORTHANC_FRAMEWORK_MAJOR}.${ORTHANC_FRAMEWORK_MINOR}.${ORTHANC_FRAMEWORK_REVISION}" VERSION_LESS "1.7.2") |
458 set(ORTHANC_FRAMEWORK_ROOT "${ORTHANC_ROOT}/Core" CACHE | |
459 STRING "Path to the Orthanc framework source directory") | |
460 set(ENABLE_PLUGINS_VERSION_SCRIPT OFF) | |
461 else() | |
462 set(ORTHANC_FRAMEWORK_ROOT "${ORTHANC_ROOT}/OrthancFramework/Sources" CACHE | |
463 STRING "Path to the Orthanc framework source directory") | |
1504 | 464 endif() |
465 | |
466 unset(ORTHANC_ROOT) | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
467 endif() |
1499 | 468 |
1530 | 469 if (NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") |
470 if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/OrthancException.h OR | |
471 NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake) | |
472 message(FATAL_ERROR "Directory not containing the source code of the Orthanc framework: ${ORTHANC_FRAMEWORK_ROOT}") | |
473 endif() | |
474 endif() | |
475 | |
1499 | 476 |
477 | |
478 ## | |
479 ## Case of the Orthanc framework installed as a shared library in a | |
1508
dd1d1cc0575d
use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1504
diff
changeset
|
480 ## GNU/Linux distribution (typically Debian). New in Orthanc 1.7.2. |
1499 | 481 ## |
482 | |
483 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") | |
484 set(ORTHANC_FRAMEWORK_LIBDIR "" CACHE PATH "") | |
1810 | 485 set(ORTHANC_FRAMEWORK_USE_SHARED ON CACHE BOOL "Whether to use the shared library or the static library") |
486 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\")") | |
1499 | 487 |
488 if (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND | |
489 CMAKE_COMPILER_IS_GNUCXX) # MinGW | |
490 set(DYNAMIC_MINGW_STDLIB ON) # Disable static linking against libc (to throw exceptions) | |
491 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++") | |
492 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++") | |
493 endif() | |
494 | |
495 include(CheckIncludeFile) | |
496 include(CheckIncludeFileCXX) | |
497 include(FindPythonInterp) | |
498 include(${CMAKE_CURRENT_LIST_DIR}/Compiler.cmake) | |
499 include(${CMAKE_CURRENT_LIST_DIR}/DownloadPackage.cmake) | |
500 include(${CMAKE_CURRENT_LIST_DIR}/AutoGeneratedCode.cmake) | |
501 set(EMBED_RESOURCES_PYTHON ${CMAKE_CURRENT_LIST_DIR}/EmbedResources.py) | |
502 | |
1810 | 503 if (ORTHANC_FRAMEWORK_USE_SHARED) |
504 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) | |
505 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix) | |
1504 | 506 else() |
1810 | 507 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) |
508 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 1 Suffix) | |
509 endif() | |
510 | |
511 # The "OrthancFramework" library must be the first one to be included | |
512 if ("${ORTHANC_FRAMEWORK_LIBDIR}" STREQUAL "") | |
513 set(ORTHANC_FRAMEWORK_LIBRARIES ${Prefix}OrthancFramework${Suffix}) | |
514 else () | |
515 set(ORTHANC_FRAMEWORK_LIBRARIES ${ORTHANC_FRAMEWORK_LIBDIR}/${Prefix}OrthancFramework${Suffix}) | |
516 endif() | |
517 | |
518 if (NOT ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES STREQUAL "") | |
519 # https://stackoverflow.com/a/5272993/881731 | |
520 string(REPLACE " " ";" tmp ${ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES}) | |
521 list(APPEND ORTHANC_FRAMEWORK_LIBRARIES ${tmp}) | |
522 endif() | |
523 | |
524 # Look for the version of the mandatory dependency JsonCpp (cf. JsonCppConfiguration.cmake) | |
525 if (CMAKE_CROSSCOMPILING) | |
526 set(JSONCPP_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT}/..) | |
527 else() | |
1499 | 528 find_path(JSONCPP_INCLUDE_DIR json/reader.h |
1810 | 529 ${ORTHANC_FRAMEWORK_ROOT}/.. |
1499 | 530 /usr/include/jsoncpp |
531 /usr/local/include/jsoncpp | |
532 ) | |
1810 | 533 endif() |
1499 | 534 |
1810 | 535 message("JsonCpp include dir: ${JSONCPP_INCLUDE_DIR}") |
536 include_directories(${JSONCPP_INCLUDE_DIR}) | |
1499 | 537 |
1810 | 538 CHECK_INCLUDE_FILE_CXX(${JSONCPP_INCLUDE_DIR}/json/reader.h HAVE_JSONCPP_H) |
539 if (NOT HAVE_JSONCPP_H) | |
540 message(FATAL_ERROR "Please install the libjsoncpp-dev package") | |
541 endif() | |
1530 | 542 |
1499 | 543 # Look for Orthanc framework shared library |
544 include(CheckCXXSymbolExists) | |
545 | |
546 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") | |
547 set(ORTHANC_FRAMEWORK_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT}) | |
548 else() | |
549 find_path(ORTHANC_FRAMEWORK_INCLUDE_DIR OrthancFramework.h | |
550 /usr/include/orthanc-framework | |
551 /usr/local/include/orthanc-framework | |
552 ${ORTHANC_FRAMEWORK_ROOT} | |
553 ) | |
554 endif() | |
1508
dd1d1cc0575d
use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1504
diff
changeset
|
555 |
dd1d1cc0575d
use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1504
diff
changeset
|
556 if (${ORTHANC_FRAMEWORK_INCLUDE_DIR} STREQUAL "ORTHANC_FRAMEWORK_INCLUDE_DIR-NOTFOUND") |
dd1d1cc0575d
use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1504
diff
changeset
|
557 message(FATAL_ERROR "Cannot locate the OrthancFramework.h header") |
dd1d1cc0575d
use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1504
diff
changeset
|
558 endif() |
1499 | 559 |
560 message("Orthanc framework include dir: ${ORTHANC_FRAMEWORK_INCLUDE_DIR}") | |
561 include_directories(${ORTHANC_FRAMEWORK_INCLUDE_DIR}) | |
1810 | 562 |
563 if (ORTHANC_FRAMEWORK_USE_SHARED) | |
564 set(CMAKE_REQUIRED_INCLUDES "${ORTHANC_FRAMEWORK_INCLUDE_DIR}") | |
565 set(CMAKE_REQUIRED_LIBRARIES "${ORTHANC_FRAMEWORK_LIBRARIES}") | |
566 | |
567 check_cxx_symbol_exists("Orthanc::InitializeFramework" "OrthancFramework.h" HAVE_ORTHANC_FRAMEWORK) | |
568 if (NOT HAVE_ORTHANC_FRAMEWORK) | |
569 message(FATAL_ERROR "Cannot find the Orthanc framework") | |
1508
dd1d1cc0575d
use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1504
diff
changeset
|
570 endif() |
1810 | 571 |
572 unset(CMAKE_REQUIRED_INCLUDES) | |
573 unset(CMAKE_REQUIRED_LIBRARIES) | |
1508
dd1d1cc0575d
use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1504
diff
changeset
|
574 endif() |
1499 | 575 endif() |