Mercurial > hg > orthanc
annotate OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake @ 4437:d9473bd5ed43
upgrade to year 2021
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 06 Jan 2021 17:27:28 +0100 |
parents | 80a437bcc09b |
children | cf44052fdf60 |
rev | line source |
---|---|
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 # Orthanc - A Lightweight, RESTful DICOM Store |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
4437
d9473bd5ed43
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4436
diff
changeset
|
4 # Copyright (C) 2017-2021 Osimis S.A., Belgium |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 # |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 # This program is free software: you can redistribute it and/or |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4108
diff
changeset
|
7 # modify it under the terms of the GNU Lesser General Public License |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4108
diff
changeset
|
8 # as published by the Free Software Foundation, either version 3 of |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4108
diff
changeset
|
9 # the License, or (at your option) any later version. |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 # |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 # This program is distributed in the hope that it will be useful, but |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 # WITHOUT ANY WARRANTY; without even the implied warranty of |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4108
diff
changeset
|
14 # Lesser General Public License for more details. |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 # |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4108
diff
changeset
|
16 # You should have received a copy of the GNU Lesser General Public |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4108
diff
changeset
|
17 # License along with this program. If not, see |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4108
diff
changeset
|
18 # <http://www.gnu.org/licenses/>. |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 ## Check whether the parent script sets the mandatory variables |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 if (NOT DEFINED ORTHANC_FRAMEWORK_SOURCE OR |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
27 (NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "system" AND |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
28 NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg" AND |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "web" AND |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" AND |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "path")) |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
32 message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_SOURCE must be set to \"system\", \"hg\", \"web\", \"archive\" or \"path\"") |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 ## Detection of the requested version |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg" OR |
2533 | 41 ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" OR |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 ORTHANC_FRAMEWORK_SOURCE STREQUAL "web") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 if (NOT DEFINED ORTHANC_FRAMEWORK_VERSION) |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_VERSION must be set") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 if (DEFINED ORTHANC_FRAMEWORK_MAJOR OR |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 DEFINED ORTHANC_FRAMEWORK_MINOR OR |
2533 | 49 DEFINED ORTHANC_FRAMEWORK_REVISION OR |
50 DEFINED ORTHANC_FRAMEWORK_MD5) | |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 message(FATAL_ERROR "Some internal variable has been set") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 |
2533 | 54 set(ORTHANC_FRAMEWORK_MD5 "") |
55 | |
2688 | 56 if (NOT DEFINED ORTHANC_FRAMEWORK_BRANCH) |
57 if (ORTHANC_FRAMEWORK_VERSION STREQUAL "mainline") | |
58 set(ORTHANC_FRAMEWORK_BRANCH "default") | |
3407
b7728227a852
C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3318
diff
changeset
|
59 set(ORTHANC_FRAMEWORK_MAJOR 999) |
b7728227a852
C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3318
diff
changeset
|
60 set(ORTHANC_FRAMEWORK_MINOR 999) |
b7728227a852
C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3318
diff
changeset
|
61 set(ORTHANC_FRAMEWORK_REVISION 999) |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 |
2688 | 63 else() |
64 set(ORTHANC_FRAMEWORK_BRANCH "Orthanc-${ORTHANC_FRAMEWORK_VERSION}") | |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 |
2688 | 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}) | |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 |
2688 | 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() | |
2533 | 76 |
2688 | 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") | |
2740 | 81 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.4.0") |
82 set(ORTHANC_FRAMEWORK_MD5 "81e15f34d97ac32bbd7d26e85698835a") | |
2915
9abcfd97a76b
Orthanc framework 1.4.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2838
diff
changeset
|
83 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.4.1") |
9abcfd97a76b
Orthanc framework 1.4.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2838
diff
changeset
|
84 set(ORTHANC_FRAMEWORK_MD5 "9b6f6114264b17ed421b574cd6476127") |
2838
f3a2d109e361
new orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2740
diff
changeset
|
85 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.4.2") |
f3a2d109e361
new orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2740
diff
changeset
|
86 set(ORTHANC_FRAMEWORK_MD5 "d1ee84927dcf668e60eb5868d24b9394") |
2993 | 87 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.0") |
88 set(ORTHANC_FRAMEWORK_MD5 "4429d8d9dea4ff6648df80ec3c64d79e") | |
3044 | 89 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.1") |
90 set(ORTHANC_FRAMEWORK_MD5 "099671538865e5da96208b37494d6718") | |
3152 | 91 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.2") |
92 set(ORTHANC_FRAMEWORK_MD5 "8867050f3e9a1ce6157c1ea7a9433b1b") | |
3170 | 93 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.3") |
94 set(ORTHANC_FRAMEWORK_MD5 "bf2f5ed1adb8b0fc5f10d278e68e1dfe") | |
3213 | 95 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.4") |
96 set(ORTHANC_FRAMEWORK_MD5 "404baef5d4c43e7c5d9410edda8ef5a5") | |
3307 | 97 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.5") |
98 set(ORTHANC_FRAMEWORK_MD5 "cfc437e0687ae4bd725fd93dc1f08bc4") | |
3318 | 99 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.6") |
100 set(ORTHANC_FRAMEWORK_MD5 "3c29de1e289b5472342947168f0105c0") | |
3450 | 101 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.7") |
102 set(ORTHANC_FRAMEWORK_MD5 "e1b76f01116d9b5d4ac8cc39980560e3") | |
3542 | 103 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.8") |
104 set(ORTHANC_FRAMEWORK_MD5 "82323e8c49a667f658a3639ea4dbc336") | |
3780 | 105 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.6.0") |
106 set(ORTHANC_FRAMEWORK_MD5 "eab428d6e53f61e847fa360bb17ebe25") | |
3856 | 107 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.6.1") |
108 set(ORTHANC_FRAMEWORK_MD5 "3971f5de96ba71dc9d3f3690afeaa7c0") | |
3969 | 109 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.0") |
110 set(ORTHANC_FRAMEWORK_MD5 "ce5f689e852b01d3672bd3d2f952a5ef") | |
3983 | 111 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.1") |
112 set(ORTHANC_FRAMEWORK_MD5 "3c171217f930abe80246997bdbcaf7cc") | |
4132 | 113 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.2") |
114 set(ORTHANC_FRAMEWORK_MD5 "328f94dcbd78c169655a13f7ad58a2c2") | |
4160 | 115 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.3") |
4163
d0f9e29a751b
fix md5 of Orthanc framework package
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4160
diff
changeset
|
116 set(ORTHANC_FRAMEWORK_MD5 "3f1ba9502ec7c5449971d3b56087bcde") |
4208 | 117 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.4") |
118 set(ORTHANC_FRAMEWORK_MD5 "19fcb7c21876af86546baa048a22c6c0") | |
4255 | 119 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.8.0") |
120 set(ORTHANC_FRAMEWORK_MD5 "f8ec7554ef5d23ea4ce474b1e8214de9") | |
4353 | 121 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.8.1") |
122 set(ORTHANC_FRAMEWORK_MD5 "db094f96399cbe8b9bbdbce34884c220") | |
4388 | 123 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.8.2") |
124 set(ORTHANC_FRAMEWORK_MD5 "8bfa10e66c9931e74111be0bfb1f4548") | |
3717
914f783ef085
development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
125 |
914f783ef085
development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
126 # Below this point are development snapshots that were used to |
914f783ef085
development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
127 # release some plugin, before an official release of the Orthanc |
914f783ef085
development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
128 # framework was available. Here is the command to be used to |
914f783ef085
development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
129 # generate a proper archive: |
914f783ef085
development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
130 # |
914f783ef085
development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
131 # $ hg archive /tmp/Orthanc-`hg id -i | sed 's/\+//'`.tar.gz |
914f783ef085
development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
132 # |
914f783ef085
development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
133 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "ae0e3fd609df") |
914f783ef085
development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
134 # DICOMweb 1.1 (framework pre-1.6.0) |
914f783ef085
development snapshot of the Orthanc framework for DICOMweb 1.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
135 set(ORTHANC_FRAMEWORK_MD5 "7e09e9b530a2f527854f0b782d7e0645") |
4336
9b38aadd4a99
tagging pre-release of the Orthanc Framework for Stone Web viewer 1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4255
diff
changeset
|
136 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "82652c5fc04f") |
9b38aadd4a99
tagging pre-release of the Orthanc Framework for Stone Web viewer 1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4255
diff
changeset
|
137 # Stone Web viewer 1.0 (framework pre-1.8.1) |
9b38aadd4a99
tagging pre-release of the Orthanc Framework for Stone Web viewer 1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4255
diff
changeset
|
138 set(ORTHANC_FRAMEWORK_MD5 "d77331d68917e66a3f4f9b807bbdab7f") |
4372
bda867e036f3
tagging Orthanc framework 4a3ba4bf4ba7 for PostgreSQL 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4369
diff
changeset
|
139 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "4a3ba4bf4ba7") |
bda867e036f3
tagging Orthanc framework 4a3ba4bf4ba7 for PostgreSQL 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4369
diff
changeset
|
140 # PostgreSQL 3.3 (framework pre-1.8.2) |
bda867e036f3
tagging Orthanc framework 4a3ba4bf4ba7 for PostgreSQL 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4369
diff
changeset
|
141 set(ORTHANC_FRAMEWORK_MD5 "2d82bddf06f9cfe82095495cb3b8abde") |
4436
80a437bcc09b
pre-release of Orthanc framework 23ad1b9c7800
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4388
diff
changeset
|
142 elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "23ad1b9c7800") |
80a437bcc09b
pre-release of Orthanc framework 23ad1b9c7800
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4388
diff
changeset
|
143 # For "Toolbox::ReadJson()" and "Toolbox::Write{...}Json()" (pre-1.9.0) |
80a437bcc09b
pre-release of Orthanc framework 23ad1b9c7800
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4388
diff
changeset
|
144 set(ORTHANC_FRAMEWORK_MD5 "9af92080e57c60dd288eba46ce606c00") |
2688 | 145 endif() |
2533 | 146 endif() |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 endif() |
4042
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
148 |
4135
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
149 elseif (ORTHANC_FRAMEWORK_SOURCE STREQUAL "path") |
3407
b7728227a852
C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3318
diff
changeset
|
150 message("Using the Orthanc framework from a path of the filesystem. Assuming mainline version.") |
b7728227a852
C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3318
diff
changeset
|
151 set(ORTHANC_FRAMEWORK_MAJOR 999) |
b7728227a852
C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3318
diff
changeset
|
152 set(ORTHANC_FRAMEWORK_MINOR 999) |
b7728227a852
C++ wrappers: compatibility mode if missing OrthancPluginRegisterMultipartRestCallback()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3318
diff
changeset
|
153 set(ORTHANC_FRAMEWORK_REVISION 999) |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 ## Detection of the third-party software |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
160 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 find_program(ORTHANC_FRAMEWORK_HG hg) |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
164 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
165 if (${ORTHANC_FRAMEWORK_HG} MATCHES "ORTHANC_FRAMEWORK_HG-NOTFOUND") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
166 message(FATAL_ERROR "Please install Mercurial") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
167 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
169 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
170 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" OR |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 ORTHANC_FRAMEWORK_SOURCE STREQUAL "web") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
173 if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
174 find_program(ORTHANC_FRAMEWORK_7ZIP 7z |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 PATHS |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
176 "$ENV{ProgramFiles}/7-Zip" |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
177 "$ENV{ProgramW6432}/7-Zip" |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 ) |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
179 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
180 if (${ORTHANC_FRAMEWORK_7ZIP} MATCHES "ORTHANC_FRAMEWORK_7ZIP-NOTFOUND") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
181 message(FATAL_ERROR "Please install the '7-zip' software (http://www.7-zip.org/)") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
182 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
183 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
184 else() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 find_program(ORTHANC_FRAMEWORK_TAR tar) |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 if (${ORTHANC_FRAMEWORK_TAR} MATCHES "ORTHANC_FRAMEWORK_TAR-NOTFOUND") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
187 message(FATAL_ERROR "Please install the 'tar' package") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
188 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
190 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
191 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
192 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
193 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
194 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
195 ## Case of the Orthanc framework specified as a path on the filesystem |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
196 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
197 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
198 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "path") |
4135
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
199 if (NOT DEFINED ORTHANC_FRAMEWORK_ROOT OR |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
200 ORTHANC_FRAMEWORK_ROOT STREQUAL "") |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
201 message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_ROOT must provide the path to the sources of Orthanc") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
202 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
203 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
204 if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}) |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
205 message(FATAL_ERROR "Non-existing directory: ${ORTHANC_FRAMEWORK_ROOT}") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
206 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
207 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
208 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
209 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
210 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
211 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
212 ## Case of the Orthanc framework cloned using Mercurial |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
213 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
214 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
215 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg") |
2534 | 216 if (NOT STATIC_BUILD AND NOT ALLOW_DOWNLOADS) |
217 message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON") | |
218 endif() | |
219 | |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
220 set(ORTHANC_ROOT ${CMAKE_BINARY_DIR}/orthanc) |
2534 | 221 |
2537 | 222 if (EXISTS ${ORTHANC_ROOT}) |
223 message("Updating the Orthanc source repository using Mercurial") | |
224 execute_process( | |
225 COMMAND ${ORTHANC_FRAMEWORK_HG} pull | |
226 WORKING_DIRECTORY ${ORTHANC_ROOT} | |
227 RESULT_VARIABLE Failure | |
228 ) | |
229 else() | |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
230 message("Forking the Orthanc source repository using Mercurial") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
231 execute_process( |
3853 | 232 COMMAND ${ORTHANC_FRAMEWORK_HG} clone "https://hg.orthanc-server.com/orthanc/" |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
233 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
234 RESULT_VARIABLE Failure |
2537 | 235 ) |
236 endif() | |
237 | |
238 if (Failure OR NOT EXISTS ${ORTHANC_ROOT}) | |
239 message(FATAL_ERROR "Cannot fork the Orthanc repository") | |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
240 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
241 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
242 message("Setting branch of the Orthanc repository to: ${ORTHANC_FRAMEWORK_BRANCH}") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
243 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
244 execute_process( |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
245 COMMAND ${ORTHANC_FRAMEWORK_HG} update -c ${ORTHANC_FRAMEWORK_BRANCH} |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
246 WORKING_DIRECTORY ${ORTHANC_ROOT} |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
247 RESULT_VARIABLE Failure |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
248 ) |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
249 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
250 if (Failure) |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
251 message(FATAL_ERROR "Error while running Mercurial") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
252 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
253 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
254 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
255 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
256 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
257 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
258 ## Case of the Orthanc framework provided as a source archive on the |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
259 ## filesystem |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
260 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
261 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
262 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive") |
4135
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
263 if (NOT DEFINED ORTHANC_FRAMEWORK_ARCHIVE OR |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
264 ORTHANC_FRAMEWORK_ARCHIVE STREQUAL "") |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
265 message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_ARCHIVE must provide the path to the sources of Orthanc") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
266 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
267 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
268 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
269 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
270 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
271 ## |
2547
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2537
diff
changeset
|
272 ## Case of the Orthanc framework downloaded from the Web |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
273 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
274 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
275 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "web") |
2547
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2537
diff
changeset
|
276 if (DEFINED ORTHANC_FRAMEWORK_URL) |
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2537
diff
changeset
|
277 string(REGEX REPLACE "^.*/" "" ORTHANC_FRAMEMORK_FILENAME "${ORTHANC_FRAMEWORK_URL}") |
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2537
diff
changeset
|
278 else() |
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2537
diff
changeset
|
279 # Default case: Download from the official Web site |
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2537
diff
changeset
|
280 set(ORTHANC_FRAMEMORK_FILENAME Orthanc-${ORTHANC_FRAMEWORK_VERSION}.tar.gz) |
3135 | 281 set(ORTHANC_FRAMEWORK_URL "http://orthanc.osimis.io/ThirdPartyDownloads/orthanc-framework/${ORTHANC_FRAMEMORK_FILENAME}") |
2547
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2537
diff
changeset
|
282 endif() |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
283 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
284 set(ORTHANC_FRAMEWORK_ARCHIVE "${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${ORTHANC_FRAMEMORK_FILENAME}") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
285 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
286 if (NOT EXISTS "${ORTHANC_FRAMEWORK_ARCHIVE}") |
2534 | 287 if (NOT STATIC_BUILD AND NOT ALLOW_DOWNLOADS) |
288 message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON") | |
289 endif() | |
290 | |
2547
8b6b0b6ece6b
MinGW, ORTHANC_FRAMEWORK_URL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2537
diff
changeset
|
291 message("Downloading: ${ORTHANC_FRAMEWORK_URL}") |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
292 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
293 file(DOWNLOAD |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
294 "${ORTHANC_FRAMEWORK_URL}" "${ORTHANC_FRAMEWORK_ARCHIVE}" |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
295 SHOW_PROGRESS EXPECTED_MD5 "${ORTHANC_FRAMEWORK_MD5}" |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
296 TIMEOUT 60 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
297 INACTIVITY_TIMEOUT 60 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
298 ) |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
299 else() |
2533 | 300 message("Using local copy of: ${ORTHANC_FRAMEWORK_URL}") |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
301 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
302 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
303 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
304 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
305 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
306 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
307 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
308 ## Uncompressing the Orthanc framework, if it was retrieved from a |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
309 ## source archive on the filesystem, or from the official Web site |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
310 ## |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
311 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
312 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" OR |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
313 ORTHANC_FRAMEWORK_SOURCE STREQUAL "web") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
314 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
315 if (NOT DEFINED ORTHANC_FRAMEWORK_ARCHIVE OR |
2533 | 316 NOT DEFINED ORTHANC_FRAMEWORK_VERSION OR |
317 NOT DEFINED ORTHANC_FRAMEWORK_MD5) | |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
318 message(FATAL_ERROR "Internal error") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
319 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
320 |
2533 | 321 if (ORTHANC_FRAMEWORK_MD5 STREQUAL "") |
322 message(FATAL_ERROR "Unknown release of Orthanc: ${ORTHANC_FRAMEWORK_VERSION}") | |
323 endif() | |
324 | |
325 file(MD5 ${ORTHANC_FRAMEWORK_ARCHIVE} ActualMD5) | |
326 | |
327 if (NOT "${ActualMD5}" STREQUAL "${ORTHANC_FRAMEWORK_MD5}") | |
328 message(FATAL_ERROR "The MD5 hash of the Orthanc archive is invalid: ${ORTHANC_FRAMEWORK_ARCHIVE}") | |
329 endif() | |
330 | |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
331 set(ORTHANC_ROOT "${CMAKE_BINARY_DIR}/Orthanc-${ORTHANC_FRAMEWORK_VERSION}") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
332 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
333 if (NOT IS_DIRECTORY "${ORTHANC_ROOT}") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
334 if (NOT ORTHANC_FRAMEWORK_ARCHIVE MATCHES ".tar.gz$") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
335 message(FATAL_ERROR "Archive should have the \".tar.gz\" extension: ${ORTHANC_FRAMEWORK_ARCHIVE}") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
336 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
337 |
2533 | 338 message("Uncompressing: ${ORTHANC_FRAMEWORK_ARCHIVE}") |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
339 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
340 if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
341 # How to silently extract files using 7-zip |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
342 # http://superuser.com/questions/331148/7zip-command-line-extract-silently-quietly |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
343 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
344 execute_process( |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
345 COMMAND ${ORTHANC_FRAMEWORK_7ZIP} e -y ${ORTHANC_FRAMEWORK_ARCHIVE} |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
346 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
347 RESULT_VARIABLE Failure |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
348 OUTPUT_QUIET |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
349 ) |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
350 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
351 if (Failure) |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
352 message(FATAL_ERROR "Error while running the uncompression tool") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
353 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
354 |
2553 | 355 get_filename_component(TMP_FILENAME "${ORTHANC_FRAMEWORK_ARCHIVE}" NAME) |
356 string(REGEX REPLACE ".gz$" "" TMP_FILENAME2 "${TMP_FILENAME}") | |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
357 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
358 execute_process( |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
359 COMMAND ${ORTHANC_FRAMEWORK_7ZIP} x -y ${TMP_FILENAME2} |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
360 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
361 RESULT_VARIABLE Failure |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
362 OUTPUT_QUIET |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
363 ) |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
364 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
365 else() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
366 execute_process( |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
367 COMMAND sh -c "${ORTHANC_FRAMEWORK_TAR} xfz ${ORTHANC_FRAMEWORK_ARCHIVE}" |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
368 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
369 RESULT_VARIABLE Failure |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
370 ) |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
371 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
372 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
373 if (Failure) |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
374 message(FATAL_ERROR "Error while running the uncompression tool") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
375 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
376 |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
377 if (NOT IS_DIRECTORY "${ORTHANC_ROOT}") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
378 message(FATAL_ERROR "The Orthanc framework was not uncompressed at the proper location. Check the CMake instructions.") |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
379 endif() |
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
380 endif() |
4135
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
381 endif() |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
382 |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
383 |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
384 |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
385 ## |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
386 ## Determine the path to the sources of the Orthanc framework |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
387 ## |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
388 |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
389 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" OR |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
390 ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg" OR |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
391 ORTHANC_FRAMEWORK_SOURCE STREQUAL "web") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
392 if (NOT DEFINED ORTHANC_ROOT OR |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
393 NOT DEFINED ORTHANC_FRAMEWORK_MAJOR OR |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
394 NOT DEFINED ORTHANC_FRAMEWORK_MINOR OR |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
395 NOT DEFINED ORTHANC_FRAMEWORK_REVISION) |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
396 message(FATAL_ERROR "Internal error in the DownloadOrthancFramework.cmake file") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
397 endif() |
4071
d6b7fb0f9652
improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
398 |
d6b7fb0f9652
improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
399 unset(ORTHANC_FRAMEWORK_ROOT CACHE) |
d6b7fb0f9652
improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
400 |
4135
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
401 if ("${ORTHANC_FRAMEWORK_MAJOR}.${ORTHANC_FRAMEWORK_MINOR}.${ORTHANC_FRAMEWORK_REVISION}" VERSION_LESS "1.7.2") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
402 set(ORTHANC_FRAMEWORK_ROOT "${ORTHANC_ROOT}/Core" CACHE |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
403 STRING "Path to the Orthanc framework source directory") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
404 set(ENABLE_PLUGINS_VERSION_SCRIPT OFF) |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
405 else() |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
406 set(ORTHANC_FRAMEWORK_ROOT "${ORTHANC_ROOT}/OrthancFramework/Sources" CACHE |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
407 STRING "Path to the Orthanc framework source directory") |
4071
d6b7fb0f9652
improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
408 endif() |
d6b7fb0f9652
improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
409 |
d6b7fb0f9652
improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
410 unset(ORTHANC_ROOT) |
2531
b7ed112ce56e
DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
411 endif() |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
412 |
4135
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
413 if (NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
414 if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/OrthancException.h OR |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
415 NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake) |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
416 message(FATAL_ERROR "Directory not containing the source code of the Orthanc framework: ${ORTHANC_FRAMEWORK_ROOT}") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
417 endif() |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
418 endif() |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
419 |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
420 |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
421 |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
422 ## |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
423 ## Case of the Orthanc framework installed as a shared library in a |
4102
2ace6dc9b1d7
removed Google Test from DownloadOrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4097
diff
changeset
|
424 ## GNU/Linux distribution (typically Debian). New in Orthanc 1.7.2. |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
425 ## |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
426 |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
427 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
428 set(ORTHANC_FRAMEWORK_LIBDIR "" CACHE PATH "") |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
429 |
4042
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
430 if (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
431 CMAKE_COMPILER_IS_GNUCXX) # MinGW |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
432 set(DYNAMIC_MINGW_STDLIB ON) # Disable static linking against libc (to throw exceptions) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
433 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++") |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
434 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++") |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
435 endif() |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
436 |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
437 include(CheckIncludeFile) |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
438 include(CheckIncludeFileCXX) |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
439 include(FindPythonInterp) |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
440 include(${CMAKE_CURRENT_LIST_DIR}/Compiler.cmake) |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
441 include(${CMAKE_CURRENT_LIST_DIR}/DownloadPackage.cmake) |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
442 include(${CMAKE_CURRENT_LIST_DIR}/AutoGeneratedCode.cmake) |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
443 set(EMBED_RESOURCES_PYTHON ${CMAKE_CURRENT_LIST_DIR}/EmbedResources.py) |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
444 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
445 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
446 ORTHANC_FRAMEWORK_STATIC) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
447 include_directories(${ORTHANC_FRAMEWORK_ROOT}/..) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
448 else() |
4042
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
449 # Look for mandatory dependency JsonCpp (cf. JsonCppConfiguration.cmake) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
450 find_path(JSONCPP_INCLUDE_DIR json/reader.h |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
451 /usr/include/jsoncpp |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
452 /usr/local/include/jsoncpp |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
453 ) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
454 |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
455 message("JsonCpp include dir: ${JSONCPP_INCLUDE_DIR}") |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
456 include_directories(${JSONCPP_INCLUDE_DIR}) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
457 link_libraries(jsoncpp) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
458 |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
459 CHECK_INCLUDE_FILE_CXX(${JSONCPP_INCLUDE_DIR}/json/reader.h HAVE_JSONCPP_H) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
460 if (NOT HAVE_JSONCPP_H) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
461 message(FATAL_ERROR "Please install the libjsoncpp-dev package") |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
462 endif() |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
463 |
4135
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
464 # Switch to the C++11 standard if the version of JsonCpp is 1.y.z |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
465 # (same as variable JSONCPP_CXX11 in the source code of Orthanc) |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
466 if (EXISTS ${JSONCPP_INCLUDE_DIR}/json/version.h) |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
467 file(STRINGS |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
468 "${JSONCPP_INCLUDE_DIR}/json/version.h" |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
469 JSONCPP_VERSION_MAJOR1 REGEX |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
470 ".*define JSONCPP_VERSION_MAJOR.*") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
471 |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
472 if (NOT JSONCPP_VERSION_MAJOR1) |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
473 message(FATAL_ERROR "Unable to extract the major version of JsonCpp") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
474 endif() |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
475 |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
476 string(REGEX REPLACE |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
477 ".*JSONCPP_VERSION_MAJOR.*([0-9]+)$" "\\1" |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
478 JSONCPP_VERSION_MAJOR ${JSONCPP_VERSION_MAJOR1}) |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
479 message("JsonCpp major version: ${JSONCPP_VERSION_MAJOR}") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
480 |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
481 if (JSONCPP_VERSION_MAJOR GREATER 0) |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
482 message("Switching to C++11 standard, as version of JsonCpp is >= 1.0.0") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
483 if (CMAKE_COMPILER_IS_GNUCXX) |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
484 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
485 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
486 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
487 endif() |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
488 endif() |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
489 else() |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
490 message("Unable to detect the major version of JsonCpp, assuming < 1.0.0") |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
491 endif() |
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4132
diff
changeset
|
492 |
4042
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
493 # Look for mandatory dependency Boost (cf. BoostConfiguration.cmake) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
494 include(FindBoost) |
4105
c02a2d9efbc2
move FromDcmtkBridge::ExecuteToDicom() to LuaFunctionCall, to remove dependency of DCMTK on Lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4102
diff
changeset
|
495 find_package(Boost COMPONENTS filesystem thread system date_time regex ${ORTHANC_BOOST_COMPONENTS}) |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
496 |
4042
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
497 if (NOT Boost_FOUND) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
498 message(FATAL_ERROR "Unable to locate Boost on this system") |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
499 endif() |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
500 |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
501 include_directories(${Boost_INCLUDE_DIRS}) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
502 link_libraries(${Boost_LIBRARIES}) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
503 |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
504 # Optional component - Lua |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
505 if (ENABLE_LUA) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
506 include(FindLua) |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
507 |
4042
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
508 if (NOT LUA_FOUND) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
509 message(FATAL_ERROR "Please install the liblua-dev package") |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
510 endif() |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
511 |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
512 include_directories(${LUA_INCLUDE_DIR}) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
513 link_libraries(${LUA_LIBRARIES}) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
514 endif() |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
515 |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
516 # Optional component - SQLite |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
517 if (ENABLE_SQLITE) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
518 CHECK_INCLUDE_FILE(sqlite3.h HAVE_SQLITE_H) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
519 if (NOT HAVE_SQLITE_H) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
520 message(FATAL_ERROR "Please install the libsqlite3-dev package") |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
521 endif() |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
522 link_libraries(sqlite3) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
523 endif() |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
524 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
525 # Optional component - Pugixml |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
526 if (ENABLE_PUGIXML) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
527 CHECK_INCLUDE_FILE_CXX(pugixml.hpp HAVE_PUGIXML_H) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
528 if (NOT HAVE_PUGIXML_H) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
529 message(FATAL_ERROR "Please install the libpugixml-dev package") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
530 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
531 link_libraries(pugixml) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
532 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
533 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
534 # Optional component - DCMTK |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
535 if (ENABLE_DCMTK) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
536 include(FindDCMTK) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
537 include_directories(${DCMTK_INCLUDE_DIRS}) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
538 link_libraries(${DCMTK_LIBRARIES}) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
539 endif() |
4369
39bc2fb4657b
look for openssl in DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4353
diff
changeset
|
540 |
39bc2fb4657b
look for openssl in DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4353
diff
changeset
|
541 # Optional component - OpenSSL |
39bc2fb4657b
look for openssl in DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4353
diff
changeset
|
542 if (ENABLE_SSL) |
39bc2fb4657b
look for openssl in DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4353
diff
changeset
|
543 include(FindOpenSSL) |
39bc2fb4657b
look for openssl in DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4353
diff
changeset
|
544 if (NOT ${OPENSSL_FOUND}) |
39bc2fb4657b
look for openssl in DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4353
diff
changeset
|
545 message(FATAL_ERROR "Unable to find OpenSSL") |
39bc2fb4657b
look for openssl in DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4353
diff
changeset
|
546 endif() |
39bc2fb4657b
look for openssl in DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4353
diff
changeset
|
547 include_directories(${OPENSSL_INCLUDE_DIR}) |
39bc2fb4657b
look for openssl in DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4353
diff
changeset
|
548 link_libraries(${OPENSSL_LIBRARIES}) |
39bc2fb4657b
look for openssl in DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4353
diff
changeset
|
549 endif() |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
550 endif() |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
551 |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
552 # Look for Orthanc framework shared library |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
553 include(CheckCXXSymbolExists) |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
554 |
4042
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
555 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
556 set(ORTHANC_FRAMEWORK_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT}) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
557 else() |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
558 find_path(ORTHANC_FRAMEWORK_INCLUDE_DIR OrthancFramework.h |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
559 /usr/include/orthanc-framework |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
560 /usr/local/include/orthanc-framework |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
561 ${ORTHANC_FRAMEWORK_ROOT} |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
562 ) |
f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4037
diff
changeset
|
563 endif() |
4097
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
564 |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
565 if (${ORTHANC_FRAMEWORK_INCLUDE_DIR} STREQUAL "ORTHANC_FRAMEWORK_INCLUDE_DIR-NOTFOUND") |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
566 message(FATAL_ERROR "Cannot locate the OrthancFramework.h header") |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
567 endif() |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
568 |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
569 message("Orthanc framework include dir: ${ORTHANC_FRAMEWORK_INCLUDE_DIR}") |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
570 include_directories(${ORTHANC_FRAMEWORK_INCLUDE_DIR}) |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
571 |
4097
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
572 if ("${ORTHANC_FRAMEWORK_LIBDIR}" STREQUAL "") |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
573 set(ORTHANC_FRAMEWORK_LIBRARIES OrthancFramework) |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
574 else() |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
575 if (MSVC) |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
576 set(Suffix ".lib") |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
577 set(Prefix "") |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
578 else() |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
579 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
580 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix) |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
581 endif() |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
582 set(ORTHANC_FRAMEWORK_LIBRARIES ${ORTHANC_FRAMEWORK_LIBDIR}/${Prefix}OrthancFramework${Suffix}) |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
583 endif() |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
584 |
4097
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
585 set(CMAKE_REQUIRED_INCLUDES "${ORTHANC_FRAMEWORK_INCLUDE_DIR}") |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
586 set(CMAKE_REQUIRED_LIBRARIES "${ORTHANC_FRAMEWORK_LIBRARIES}") |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
587 |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
588 check_cxx_symbol_exists("Orthanc::InitializeFramework" "OrthancFramework.h" HAVE_ORTHANC_FRAMEWORK) |
4097
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
589 if (NOT HAVE_ORTHANC_FRAMEWORK) |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
590 message(FATAL_ERROR "Cannot find the Orthanc framework") |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
591 endif() |
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
592 |
4108
29cb9e47681f
fix cmake policy CMP0075
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
593 unset(CMAKE_REQUIRED_INCLUDES) |
29cb9e47681f
fix cmake policy CMP0075
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4105
diff
changeset
|
594 unset(CMAKE_REQUIRED_LIBRARIES) |
4037
5e26d004838c
adding option "system" to DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3983
diff
changeset
|
595 endif() |