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