Mercurial > hg > orthanc
annotate OrthancFramework/SharedLibrary/CMakeLists.txt @ 5652:53ddff5dccaf
revisiting NEWS
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 05 Jun 2024 15:42:57 +0200 |
parents | f7adfb22e20e |
children |
rev | line source |
---|---|
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
1 # Orthanc - A Lightweight, RESTful DICOM Store |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
5640
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
4 # Copyright (C) 2017-2023 Osimis S.A., Belgium |
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
5 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
5485
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5362
diff
changeset
|
6 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
7 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
8 # This program is free software: you can redistribute it and/or |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
9 # modify it under the terms of the GNU Lesser General Public License |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
10 # as published by the Free Software Foundation, either version 3 of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
11 # the License, or (at your option) any later version. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
12 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
13 # This program is distributed in the hope that it will be useful, but |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
14 # WITHOUT ANY WARRANTY; without even the implied warranty of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
16 # Lesser General Public License for more details. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
17 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
18 # You should have received a copy of the GNU Lesser General Public |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
19 # License along with this program. If not, see |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
20 # <http://www.gnu.org/licenses/>. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
21 |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4118
diff
changeset
|
22 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 ## To see all the exported symbols in the DLL: |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 ## |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 ## $ i686-w64-mingw32-objdump -p ./libOrthancFramework.dll |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 ## |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 ## IMPORTANT: "-static-libgcc" prevents catching exception in the |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 ## .EXE, which makes throwing exceptions crash the software! |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 ## |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 cmake_minimum_required(VERSION 2.8) |
4170
1657c8700974
better fix for CMP0058
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4135
diff
changeset
|
34 cmake_policy(SET CMP0058 NEW) |
1657c8700974
better fix for CMP0058
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4135
diff
changeset
|
35 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 project(OrthancFramework) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
38 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
39 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
40 ##################################################################### |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
41 ## Additional parameters |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
42 ##################################################################### |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
43 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 # *Do not* use CMAKE_INSTALL_PREFIX, otherwise CMake automatically |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
45 # adds CMAKE_INSTALL_PREFIX to the include_directories(), which causes |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
46 # issues if re-building the shared library after install! |
4135
baf8e21e91cb
improving DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4134
diff
changeset
|
47 set(ORTHANC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH "") |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests") |
4496
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
49 set(BUILD_SHARED_LIBRARY ON CACHE BOOL "Whether to build a shared library instead of a static library") |
4535
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
50 set(ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES "" CACHE STRING "Additional libraries to link against, separated by whitespaces, typically needed if building the static library (a common minimal value is \"boost_filesystem boost_iostreams boost_locale boost_regex boost_thread jsoncpp pugixml uuid\")") |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
53 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
54 ##################################################################### |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
55 ## Configuration of the Orthanc framework |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
56 ##################################################################### |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
57 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 # This must be before inclusion of "OrthancFrameworkParameters.cmake" to take effect |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 if (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 CMAKE_COMPILER_IS_GNUCXX) # MinGW |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 set(DYNAMIC_MINGW_STDLIB ON) # Disable static linking against libc (to throw exceptions) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/OrthancFrameworkParameters.cmake) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 |
4134
2c54cc9a712f
ORTHANC_FRAMEWORK_SOVERSION for the shared library of the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4120
diff
changeset
|
67 # "ORTHANC_VERSION" is initialized by "OrthancFrameworkParameters.cmake" |
2c54cc9a712f
ORTHANC_FRAMEWORK_SOVERSION for the shared library of the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4120
diff
changeset
|
68 set(ORTHANC_FRAMEWORK_SOVERSION "${ORTHANC_VERSION}" CACHE STRING "On GNU/Linux, the SOVERSION to be used for the shared library") |
2c54cc9a712f
ORTHANC_FRAMEWORK_SOVERSION for the shared library of the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4120
diff
changeset
|
69 |
4094
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
70 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK) |
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
71 set(STANDALONE_BUILD ON) |
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
72 else() |
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
73 set(STANDALONE_BUILD OFF) |
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
74 endif() |
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
75 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 set(ENABLE_DCMTK ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 set(ENABLE_DCMTK_TRANSCODING ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 set(ENABLE_GOOGLE_TEST ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 set(ENABLE_JPEG ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 set(ENABLE_LOCALE ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 set(ENABLE_LUA ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 set(ENABLE_PNG ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 set(ENABLE_PUGIXML ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 set(ENABLE_ZLIB ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 # WebAssembly or asm.js |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 set(BOOST_LOCALE_BACKEND "libiconv") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 set(ORTHANC_SANDBOXED ON) |
4071
d6b7fb0f9652
improved DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4067
diff
changeset
|
90 set(STANDALONE_BUILD ON) |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 |
4067 | 92 # Will be used by "../Resources/CMake/EmscriptenParameters.cmake" |
93 set(WASM_FLAGS "-s SIDE_MODULE=1 -s EXPORT_ALL=1") | |
94 | |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 else() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 # Enable all the remaining modules for other targets |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 set(ENABLE_CRYPTO_OPTIONS ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 set(ENABLE_DCMTK_NETWORKING ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 set(ENABLE_OPENSSL_ENGINES ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 set(ENABLE_SQLITE ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 set(ENABLE_WEB_CLIENT ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 set(ENABLE_WEB_SERVER ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 set(BOOST_LOCALE_BACKEND "icu") |
4431 | 105 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
106 set(USE_LEGACY_JSONCPP ON) | |
107 set(USE_LEGACY_LIBICU ON) | |
108 endif() | |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
112 set(ORTHANC_BUILDING_FRAMEWORK_LIBRARY ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/OrthancFrameworkConfiguration.cmake) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
116 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
117 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
118 ##################################################################### |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
119 ## Configuration the visibility of the third-party libraries in the |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
120 ## shared library |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
121 ##################################################################### |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
122 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 if (STATIC_BUILD OR NOT USE_SYSTEM_JSONCPP) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 set(ORTHANC_STATIC_JSONCPP ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 else() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 set(ORTHANC_STATIC_JSONCPP OFF) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 if (STATIC_BUILD OR NOT USE_SYSTEM_BOOST) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 set(ORTHANC_STATIC_BOOST ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 else() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 set(ORTHANC_STATIC_BOOST OFF) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 if (STATIC_BUILD OR NOT USE_SYSTEM_SQLITE) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 set(ORTHANC_STATIC_SQLITE ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 else() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 set(ORTHANC_STATIC_SQLITE OFF) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 if (STATIC_BUILD OR NOT USE_SYSTEM_PUGIXML) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 set(ORTHANC_STATIC_PUGIXML ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 else() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 set(ORTHANC_STATIC_PUGIXML OFF) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 |
4065
d6362b2c4b61
export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
147 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK) |
d6362b2c4b61
export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
148 set(ORTHANC_STATIC_DCMTK ON) |
d6362b2c4b61
export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
149 else() |
d6362b2c4b61
export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
150 set(ORTHANC_STATIC_DCMTK OFF) |
d6362b2c4b61
export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
151 endif() |
d6362b2c4b61
export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
152 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 CMAKE_CXX_COMPILER_ID STREQUAL "GNU") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 # Control the visibility of JsonCpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 if (ORTHANC_STATIC_JSONCPP) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
160 set_source_files_properties(${JSONCPP_SOURCES} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 PROPERTIES COMPILE_DEFINITIONS "JSON_API=__declspec(dllexport)" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 set(ORTHANC_JSON_API "__declspec(dllimport)") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
164 else() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
165 set(ORTHANC_JSON_API "__attribute__((visibility(\"default\")))") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
166 set_source_files_properties(${JSONCPP_SOURCES} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
167 PROPERTIES COMPILE_DEFINITIONS "JSON_API=${ORTHANC_JSON_API}" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
169 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
170 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 # Control the visibility of SQLite |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
173 if (ORTHANC_STATIC_SQLITE) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
174 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 set_source_files_properties(${SQLITE_SOURCES} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
176 PROPERTIES COMPILE_DEFINITIONS "SQLITE_API=__declspec(dllexport)" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
177 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 set(ORTHANC_SQLITE_API "__declspec(dllimport)") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
179 else() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
180 set(ORTHANC_SQLITE_API "__attribute__((visibility(\"default\")))") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
181 set_source_files_properties(${SQLITE_SOURCES} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
182 PROPERTIES COMPILE_DEFINITIONS "SQLITE_API=${ORTHANC_SQLITE_API}" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
183 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
184 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
187 # Control the visibility of Boost |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
188 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 ORTHANC_STATIC_BOOST) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
190 set_source_files_properties(${ORTHANC_CORE_SOURCES_INTERNAL} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
191 PROPERTIES COMPILE_DEFINITIONS "BOOST_DATE_TIME_SOURCE;BOOST_FILESYSTEM_SOURCE;BOOST_LOCALE_SOURCE;BOOST_REGEX_SOURCE" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
192 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
193 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
194 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
195 # Control the visibility of Pugixml |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
196 if (ORTHANC_STATIC_PUGIXML) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
197 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
198 set_source_files_properties(${PUGIXML_SOURCES} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
199 PROPERTIES COMPILE_DEFINITIONS "PUGIXML_API=__declspec(dllexport)" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
200 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
201 set(ORTHANC_PUGIXML_API "__declspec(dllimport)") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
202 else() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
203 set(ORTHANC_PUGIXML_API "__attribute__((visibility(\"default\")))") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
204 set_source_files_properties(${PUGIXML_SOURCES} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
205 PROPERTIES COMPILE_DEFINITIONS "PUGIXML_API=${ORTHANC_PUGIXML_API}" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
206 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
207 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
208 endif() |
4065
d6362b2c4b61
export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
209 |
d6362b2c4b61
export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
210 # Control the visibility of DCMTK: We only export the "dcmdata" module |
d6362b2c4b61
export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
211 if (ORTHANC_STATIC_DCMTK) |
d6362b2c4b61
export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
212 set_source_files_properties(${DCMTK_SOURCES} |
d6362b2c4b61
export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
213 PROPERTIES COMPILE_DEFINITIONS "DCMTK_BUILD_IN_PROGRESS;DCMTK_BUILD_SINGLE_SHARED_LIBRARY;DCMTK_SHARED;HAVE_HIDDEN_VISIBILITY;dcmdata_EXPORTS" |
d6362b2c4b61
export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
214 ) |
d6362b2c4b61
export dcmdata in shared library, rounding in convolution tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
215 endif() |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
216 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
217 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
218 |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
219 add_definitions( |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
220 -DCIVETWEB_API= # Don't export the public symbols from CivetWeb |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
221 ) |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
222 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
223 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
224 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
225 ##################################################################### |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
226 ## Building the shared library |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
227 ##################################################################### |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
228 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
229 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
230 execute_process( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
231 COMMAND |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
232 ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../Resources/WindowsResources.py |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
233 ${ORTHANC_VERSION} "OrthancFramework" OrthancFramework.dll "Shared library containing the Orthanc framework" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
234 ERROR_VARIABLE Failure |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
235 OUTPUT_FILE ${AUTOGENERATED_DIR}/Version.rc |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
236 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
237 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
238 if (Failure) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
239 message(FATAL_ERROR "Error while computing the version information: ${Failure}") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
240 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
241 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
242 list(APPEND AUTOGENERATED_SOURCES ${AUTOGENERATED_DIR}/Version.rc) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
243 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
244 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
245 |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
246 # Those two files collide with each other, and thus are merged into a |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
247 # single "DllMain.cpp" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
248 list(REMOVE_ITEM ORTHANC_CORE_SOURCES |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
249 ${BOOST_SOURCES_DIR}/libs/thread/src/win32/tss_dll.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
250 ${OPENSSL_SOURCES_DIR}/crypto/dllmain.c |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
251 ) |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
252 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
253 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
254 # In WebAssembly, a SIDE_MODULE is an executable |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
255 add_executable(OrthancFramework |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
256 ${AUTOGENERATED_SOURCES} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
257 ${ORTHANC_CORE_SOURCES} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
258 ${ORTHANC_DICOM_SOURCES} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
259 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
260 |
5362
78aad3916da4
added more DefineSourceBasenameForTarget()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5357
diff
changeset
|
261 DefineSourceBasenameForTarget(OrthancFramework) |
78aad3916da4
added more DefineSourceBasenameForTarget()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5357
diff
changeset
|
262 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
263 # CMake does not natively handle SIDE_MODULE, and believes that |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
264 # Emscripten produces a ".js" file (whereas it creates only the |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
265 # ".wasm"). Create a dummy ".js" for target to work. |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
266 add_custom_command( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
267 TARGET OrthancFramework POST_BUILD |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
268 COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/OrthancFramework.js |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
269 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
270 else() |
4496
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
271 if (BUILD_SHARED_LIBRARY) |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
272 add_library(OrthancFramework SHARED |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
273 ${AUTOGENERATED_SOURCES} |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
274 ${ORTHANC_CORE_SOURCES} |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
275 ${ORTHANC_DICOM_SOURCES} |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
276 DllMain.cpp |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
277 ) |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
278 |
5362
78aad3916da4
added more DefineSourceBasenameForTarget()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5357
diff
changeset
|
279 DefineSourceBasenameForTarget(OrthancFramework) |
78aad3916da4
added more DefineSourceBasenameForTarget()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5357
diff
changeset
|
280 |
4496
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
281 # By default, hide all the symbols |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
282 set_target_properties(OrthancFramework PROPERTIES C_VISIBILITY_PRESET hidden) |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
283 set_target_properties(OrthancFramework PROPERTIES CXX_VISIBILITY_PRESET hidden) |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
284 |
4496
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
285 # Configure the version of the shared library |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
286 set_target_properties( |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
287 OrthancFramework PROPERTIES |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
288 VERSION ${ORTHANC_VERSION} |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
289 SOVERSION ${ORTHANC_FRAMEWORK_SOVERSION} |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
290 ) |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
291 |
4496
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
292 target_link_libraries(OrthancFramework ${DCMTK_LIBRARIES}) |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
293 |
4496
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
294 if (LIBICU_LIBRARIES) |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
295 target_link_libraries(OrthancFramework ${LIBICU_LIBRARIES}) |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
296 endif() |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
297 |
4496
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
298 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
299 target_link_libraries(OrthancFramework winpthread) |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
300 endif() |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
301 else() |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
302 # Building a static library |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
303 add_library(OrthancFramework STATIC |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
304 ${AUTOGENERATED_SOURCES} |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
305 ${ORTHANC_CORE_SOURCES} |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
306 ${ORTHANC_DICOM_SOURCES} |
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
307 ) |
4531
d64e6f401a8a
additional option in DownloadOrthancFramework: ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4496
diff
changeset
|
308 |
5362
78aad3916da4
added more DefineSourceBasenameForTarget()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5357
diff
changeset
|
309 DefineSourceBasenameForTarget(OrthancFramework) |
78aad3916da4
added more DefineSourceBasenameForTarget()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5357
diff
changeset
|
310 |
4531
d64e6f401a8a
additional option in DownloadOrthancFramework: ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4496
diff
changeset
|
311 # Add the "-fPIC" option to use the static library from Orthanc |
d64e6f401a8a
additional option in DownloadOrthancFramework: ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4496
diff
changeset
|
312 # plugins (the latter being shared libraries) |
d64e6f401a8a
additional option in DownloadOrthancFramework: ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4496
diff
changeset
|
313 set_property(TARGET OrthancFramework PROPERTY POSITION_INDEPENDENT_CODE ON) |
4496
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
314 endif() |
5357
fddb5d8d0021
Prevent the leak of the full path of the source files in the binaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
315 |
fddb5d8d0021
Prevent the leak of the full path of the source files in the binaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
316 DefineSourceBasenameForTarget(OrthancFramework) |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
317 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
318 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
319 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
320 |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
321 ##################################################################### |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
322 ## Publish the headers into the "Include" folder of the build |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
323 ## directory |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
324 ##################################################################### |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
325 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
326 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
327 COPY ${CMAKE_SOURCE_DIR}/../Sources/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
328 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/orthanc-framework |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
329 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
330 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
331 PATTERN "*.h" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
332 PATTERN OrthancFramework.h EXCLUDE |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
333 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
334 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
335 configure_file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
336 ${CMAKE_SOURCE_DIR}/OrthancFramework.h.in |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
337 ${CMAKE_CURRENT_BINARY_DIR}/Include/orthanc-framework/OrthancFramework.h |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
338 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
339 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
340 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
341 if (ORTHANC_STATIC_BOOST) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
342 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
343 COPY ${BOOST_SOURCES_DIR}/boost/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
344 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/boost/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
345 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
346 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
347 PATTERN "*.h" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
348 PATTERN "*.hpp" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
349 PATTERN "*.ipp" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
350 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
351 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
352 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
353 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
354 if (ENABLE_SQLITE AND ORTHANC_STATIC_SQLITE) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
355 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
356 COPY ${SQLITE_SOURCES_DIR}/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
357 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
358 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
359 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
360 PATTERN "*.h" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
361 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
362 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
363 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
364 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
365 if (ORTHANC_STATIC_JSONCPP) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
366 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
367 COPY ${JSONCPP_SOURCES_DIR}/include/json/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
368 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/json/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
369 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
370 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
371 PATTERN "*.h" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
372 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
373 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
374 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
375 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
376 if (ENABLE_DCMTK AND (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK)) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
377 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
378 COPY ${DCMTK_SOURCES_DIR}/dcmdata/include/dcmtk/dcmdata/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
379 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/dcmtk/dcmdata/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
380 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
381 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
382 PATTERN "*.h" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
383 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
384 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
385 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
386 COPY ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
387 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/dcmtk/config/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
388 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
389 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
390 PATTERN "*.h" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
391 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
392 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
393 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
394 COPY ${DCMTK_SOURCES_DIR}/ofstd/include/dcmtk/ofstd/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
395 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/dcmtk/ofstd/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
396 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
397 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
398 PATTERN "*.h" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
399 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
400 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
401 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
402 COPY ${DCMTK_SOURCES_DIR}/oflog/include/dcmtk/oflog/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
403 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/dcmtk/oflog/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
404 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
405 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
406 PATTERN "*.h" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
407 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
408 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
409 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
410 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
411 if (ENABLE_PUGIXML AND (STATIC_BUILD OR NOT USE_SYSTEM_PUGIXML)) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
412 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
413 COPY ${PUGIXML_SOURCES_DIR}/src/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
414 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
415 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
416 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
417 PATTERN "*.hpp" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
418 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
419 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
420 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
421 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
422 if (ENABLE_LUA AND (STATIC_BUILD OR NOT USE_SYSTEM_LUA)) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
423 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
424 COPY ${LUA_SOURCES_DIR}/src/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
425 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
426 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
427 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
428 PATTERN "*.h" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
429 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
430 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
431 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
432 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
433 if (OFF) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
434 # These files are fully abstracted by the Orthanc Framework classes |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
435 if (ENABLE_PNG AND (STATIC_BUILD OR NOT USE_SYSTEM_LIBPNG)) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
436 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
437 COPY ${LIBPNG_SOURCES_DIR}/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
438 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
439 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
440 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
441 PATTERN "*.h" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
442 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
443 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
444 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
445 if (ENABLE_ZLIB AND (STATIC_BUILD OR NOT USE_SYSTEM_ZLIB)) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
446 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
447 COPY ${ZLIB_SOURCES_DIR}/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
448 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
449 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
450 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
451 PATTERN "*.h" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
452 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
453 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
454 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
455 if (ENABLE_JPEG AND (STATIC_BUILD OR NOT USE_SYSTEM_LIBJPEG)) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
456 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
457 COPY ${LIBJPEG_SOURCES_DIR}/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
458 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
459 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
460 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
461 PATTERN "*.h" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
462 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
463 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
464 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
465 if (ENABLE_WEB_CLIENT AND (STATIC_BUILD OR NOT USE_SYSTEM_CURL)) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
466 file( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
467 COPY ${CURL_SOURCES_DIR}/include/curl/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
468 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/curl/ |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
469 NO_SOURCE_PERMISSIONS |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
470 FILES_MATCHING |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
471 PATTERN "*.h" |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
472 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
473 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
474 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
475 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
476 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
477 |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
478 ##################################################################### |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
479 ## Possibly install the headers and the binaries |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
480 ##################################################################### |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
481 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
482 install( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
483 TARGETS OrthancFramework |
4103
c5efe8897da8
rename ORTHANC_INSTALL_DIR as ORTHANC_INSTALL_PREFIX for more consistency with CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4100
diff
changeset
|
484 RUNTIME DESTINATION ${ORTHANC_INSTALL_PREFIX}/lib # Destination for Windows |
c5efe8897da8
rename ORTHANC_INSTALL_DIR as ORTHANC_INSTALL_PREFIX for more consistency with CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4100
diff
changeset
|
485 LIBRARY DESTINATION ${ORTHANC_INSTALL_PREFIX}/lib # Destination for Linux |
4496
9ea70ccf0c21
Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
486 ARCHIVE DESTINATION ${ORTHANC_INSTALL_PREFIX}/lib # Destination for static library |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
487 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
488 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
489 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
490 install(FILES |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
491 ${CMAKE_CURRENT_BINARY_DIR}/OrthancFramework.wasm |
4103
c5efe8897da8
rename ORTHANC_INSTALL_DIR as ORTHANC_INSTALL_PREFIX for more consistency with CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4100
diff
changeset
|
492 DESTINATION ${ORTHANC_INSTALL_PREFIX}/lib |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
493 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
494 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
495 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
496 install( |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
497 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Include/ |
4103
c5efe8897da8
rename ORTHANC_INSTALL_DIR as ORTHANC_INSTALL_PREFIX for more consistency with CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4100
diff
changeset
|
498 DESTINATION ${ORTHANC_INSTALL_PREFIX}/include/ |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
499 ) |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
500 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
501 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
502 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
503 ##################################################################### |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
504 ## Compile the unit tests |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
505 ##################################################################### |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
506 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
507 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
508 include(ExternalProject) |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
509 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
510 if (CMAKE_TOOLCHAIN_FILE) |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
511 # Take absolute path to the toolchain |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
512 get_filename_component(TMP ${CMAKE_TOOLCHAIN_FILE} REALPATH BASE ${CMAKE_SOURCE_DIR}/..) |
4097
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4094
diff
changeset
|
513 list(APPEND Flags |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4094
diff
changeset
|
514 -DCMAKE_TOOLCHAIN_FILE=${TMP} |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4094
diff
changeset
|
515 -DLSB_CC=${LSB_CC} |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4094
diff
changeset
|
516 -DLSB_CXX=${LSB_CXX} |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4094
diff
changeset
|
517 ) |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
518 endif() |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
519 |
5073
859f3668c181
replaced macro "#warning" by "#pragma message" for Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4970
diff
changeset
|
520 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK) |
859f3668c181
replaced macro "#warning" by "#pragma message" for Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4970
diff
changeset
|
521 list(APPEND Flags |
5074 | 522 # This is necessary to compile "dcmtk/dcmdata/dctagkey.h" since |
523 # DCMTK 3.6.7 because it includes the file provided in macro | |
524 # "DCMTK_DIAGNOSTIC_IGNORE_ATTRIBUTE_REDECLARATION" | |
5073
859f3668c181
replaced macro "#warning" by "#pragma message" for Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4970
diff
changeset
|
525 -DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES=${DCMTK_SOURCES_DIR}/ofstd/include |
859f3668c181
replaced macro "#warning" by "#pragma message" for Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4970
diff
changeset
|
526 ) |
859f3668c181
replaced macro "#warning" by "#pragma message" for Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4970
diff
changeset
|
527 endif() |
859f3668c181
replaced macro "#warning" by "#pragma message" for Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4970
diff
changeset
|
528 |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
529 # Build the unit tests, linking them against the just-created |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
530 # "OrthancFramework" library |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
531 externalproject_add(UnitTests |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
532 SOURCE_DIR "${CMAKE_SOURCE_DIR}/../UnitTestsSources" |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
533 CMAKE_ARGS |
4535
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
534 ${Flags} |
4536
237ec4c5a24d
missing ALLOW_DOWNLOADS when building unit tests of framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4535
diff
changeset
|
535 -DALLOW_DOWNLOADS:BOOL=${ALLOW_DOWNLOADS} |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
536 -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} |
4535
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
537 -DORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES:STRING=${ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES} |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
538 -DORTHANC_FRAMEWORK_LIBDIR:PATH=${CMAKE_CURRENT_BINARY_DIR} |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
539 -DORTHANC_FRAMEWORK_ROOT:PATH=${CMAKE_CURRENT_BINARY_DIR}/Include/orthanc-framework |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
540 -DORTHANC_FRAMEWORK_SOURCE:STRING=system |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
541 -DORTHANC_FRAMEWORK_STATIC:BOOL=${STATIC_BUILD} |
4535
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
542 -DORTHANC_FRAMEWORK_USE_SHARED:BOOL=${BUILD_SHARED_LIBRARY} |
4094
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
543 -DSTATIC_BUILD:BOOL=${STATIC_BUILD} |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
544 -DUNIT_TESTS_WITH_HTTP_CONNEXIONS:BOOL=${UNIT_TESTS_WITH_HTTP_CONNEXIONS} |
4094
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
545 -DUSE_GOOGLE_TEST_DEBIAN_PACKAGE:BOOL=${USE_GOOGLE_TEST_DEBIAN_PACKAGE} |
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4071
diff
changeset
|
546 -DUSE_SYSTEM_GOOGLE_TEST:BOOL=${USE_SYSTEM_GOOGLE_TEST} |
4967
6119ecbd4462
pass user-specific compiler flags to the unit tests of the shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
547 |
6119ecbd4462
pass user-specific compiler flags to the unit tests of the shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
548 -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} |
6119ecbd4462
pass user-specific compiler flags to the unit tests of the shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
549 -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} |
6119ecbd4462
pass user-specific compiler flags to the unit tests of the shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
550 -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} |
6119ecbd4462
pass user-specific compiler flags to the unit tests of the shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4870
diff
changeset
|
551 -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} |
4970 | 552 -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} |
553 -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} | |
4066
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
554 ) |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
555 |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
556 add_dependencies(UnitTests OrthancFramework) |
3a59a021b5de
build instructions for the library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4065
diff
changeset
|
557 endif() |
4107
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
558 |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
559 |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
560 |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
561 ##################################################################### |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
562 ## Prepare the "uninstall" target |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
563 ## http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
564 ##################################################################### |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
565 |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
566 configure_file( |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
567 "${CMAKE_SOURCE_DIR}/../Resources/CMake/Uninstall.cmake.in" |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
568 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
569 IMMEDIATE @ONLY) |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
570 |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
571 add_custom_target(uninstall |
d36b38da5947
uninstall target for the orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4103
diff
changeset
|
572 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) |