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