Mercurial > hg > orthanc
annotate CMakeLists.txt @ 3505:b2d4dd16dae8
removed C++11 primitive
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 28 Aug 2019 12:21:23 +0200 |
parents | 54cdad5a7228 |
children | 8afc14fab01f |
rev | line source |
---|---|
2691 | 1 cmake_minimum_required(VERSION 2.8) |
2 | |
3 project(Orthanc) | |
4 | |
5 | |
6 ##################################################################### | |
7 ## Generic parameters of the Orthanc framework | |
8 ##################################################################### | |
9 | |
10 include(${CMAKE_SOURCE_DIR}/Resources/CMake/OrthancFrameworkParameters.cmake) | |
11 | |
12 # Enable all the optional components of the Orthanc framework | |
13 set(ENABLE_CRYPTO_OPTIONS ON) | |
14 set(ENABLE_DCMTK ON) | |
15 set(ENABLE_DCMTK_NETWORKING ON) | |
16 set(ENABLE_GOOGLE_TEST ON) | |
17 set(ENABLE_JPEG ON) | |
18 set(ENABLE_LOCALE ON) | |
19 set(ENABLE_LUA ON) | |
3295 | 20 set(ENABLE_OPENSSL_ENGINES ON) |
2691 | 21 set(ENABLE_PNG ON) |
22 set(ENABLE_PUGIXML ON) | |
23 set(ENABLE_SQLITE ON) | |
24 set(ENABLE_WEB_CLIENT ON) | |
25 set(ENABLE_WEB_SERVER ON) | |
26 set(ENABLE_ZLIB ON) | |
27 | |
28 set(HAS_EMBEDDED_RESOURCES ON) | |
29 | |
30 | |
31 ##################################################################### | |
32 ## CMake parameters tunable at the command line to configure the | |
33 ## plugins, the companion tools, and the unit tests | |
34 ##################################################################### | |
35 | |
36 # Parameters of the build | |
37 SET(BUILD_MODALITY_WORKLISTS ON CACHE BOOL "Whether to build the sample plugin to serve modality worklists") | |
38 SET(BUILD_RECOVER_COMPRESSED_FILE ON CACHE BOOL "Whether to build the companion tool to recover files compressed using Orthanc") | |
39 SET(BUILD_SERVE_FOLDERS ON CACHE BOOL "Whether to build the ServeFolders plugin") | |
40 SET(ENABLE_PLUGINS ON CACHE BOOL "Enable plugins") | |
41 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests") | |
42 | |
43 | |
44 ##################################################################### | |
45 ## Configuration of the Orthanc framework | |
46 ##################################################################### | |
47 | |
48 include(${CMAKE_SOURCE_DIR}/Resources/CMake/VisualStudioPrecompiledHeaders.cmake) | |
49 include(${CMAKE_SOURCE_DIR}/Resources/CMake/OrthancFrameworkConfiguration.cmake) | |
50 | |
51 | |
52 ##################################################################### | |
53 ## List of source files | |
54 ##################################################################### | |
55 | |
56 set(ORTHANC_SERVER_SOURCES | |
3093
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3091
diff
changeset
|
57 OrthancServer/Database/Compatibility/DatabaseLookup.cpp |
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3091
diff
changeset
|
58 OrthancServer/Database/Compatibility/ICreateInstance.cpp |
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3091
diff
changeset
|
59 OrthancServer/Database/Compatibility/IGetChildrenMetadata.cpp |
3187
4bbadcd03966
refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3095
diff
changeset
|
60 OrthancServer/Database/Compatibility/ILookupResourceAndParent.cpp |
3093
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3091
diff
changeset
|
61 OrthancServer/Database/Compatibility/ILookupResources.cpp |
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3091
diff
changeset
|
62 OrthancServer/Database/Compatibility/SetOfResources.cpp |
3094
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
63 OrthancServer/Database/ResourcesContent.cpp |
3093
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3091
diff
changeset
|
64 OrthancServer/Database/SQLiteDatabaseWrapper.cpp |
2691 | 65 OrthancServer/DicomInstanceOrigin.cpp |
66 OrthancServer/DicomInstanceToStore.cpp | |
67 OrthancServer/ExportedResource.cpp | |
68 OrthancServer/LuaScripting.cpp | |
2933
4a38d7d4f0e0
new class: OrthancConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2893
diff
changeset
|
69 OrthancServer/OrthancConfiguration.cpp |
2691 | 70 OrthancServer/OrthancFindRequestHandler.cpp |
71 OrthancServer/OrthancHttpHandler.cpp | |
72 OrthancServer/OrthancInitialization.cpp | |
73 OrthancServer/OrthancMoveRequestHandler.cpp | |
74 OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp | |
75 OrthancServer/OrthancRestApi/OrthancRestApi.cpp | |
76 OrthancServer/OrthancRestApi/OrthancRestArchive.cpp | |
77 OrthancServer/OrthancRestApi/OrthancRestChanges.cpp | |
78 OrthancServer/OrthancRestApi/OrthancRestModalities.cpp | |
79 OrthancServer/OrthancRestApi/OrthancRestResources.cpp | |
80 OrthancServer/OrthancRestApi/OrthancRestSystem.cpp | |
81 OrthancServer/QueryRetrieveHandler.cpp | |
3029
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3018
diff
changeset
|
82 OrthancServer/Search/DatabaseConstraint.cpp |
2892
ce310baccda6
DicomTagConstraint and DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
83 OrthancServer/Search/DatabaseLookup.cpp |
ce310baccda6
DicomTagConstraint and DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
84 OrthancServer/Search/DicomTagConstraint.cpp |
2691 | 85 OrthancServer/Search/HierarchicalMatcher.cpp |
3058
6faf575ba9cc
refactoring: class ISqlLookupFormatter to be used in orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3057
diff
changeset
|
86 OrthancServer/Search/ISqlLookupFormatter.cpp |
2691 | 87 OrthancServer/ServerContext.cpp |
88 OrthancServer/ServerEnumerations.cpp | |
89 OrthancServer/ServerIndex.cpp | |
90 OrthancServer/ServerJobs/ArchiveJob.cpp | |
91 OrthancServer/ServerJobs/DicomModalityStoreJob.cpp | |
2867 | 92 OrthancServer/ServerJobs/DicomMoveScuJob.cpp |
2691 | 93 OrthancServer/ServerJobs/LuaJobManager.cpp |
2853
52b017d22a4f
New URI: "/studies/.../merge" to merge a study
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2844
diff
changeset
|
94 OrthancServer/ServerJobs/MergeStudyJob.cpp |
2691 | 95 OrthancServer/ServerJobs/Operations/DeleteResourceOperation.cpp |
3095
beeeb6096f27
removing dependencies upon ServerContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3094
diff
changeset
|
96 OrthancServer/ServerJobs/Operations/DicomInstanceOperationValue.cpp |
2691 | 97 OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.cpp |
98 OrthancServer/ServerJobs/Operations/StorePeerOperation.cpp | |
99 OrthancServer/ServerJobs/Operations/StoreScuOperation.cpp | |
100 OrthancServer/ServerJobs/Operations/SystemCallOperation.cpp | |
101 OrthancServer/ServerJobs/OrthancJobUnserializer.cpp | |
102 OrthancServer/ServerJobs/OrthancPeerStoreJob.cpp | |
103 OrthancServer/ServerJobs/ResourceModificationJob.cpp | |
2844
99863d6245b2
New URI: "/studies/.../split" to split a study
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2808
diff
changeset
|
104 OrthancServer/ServerJobs/SplitStudyJob.cpp |
2691 | 105 OrthancServer/ServerToolbox.cpp |
106 OrthancServer/SliceOrdering.cpp | |
107 ) | |
108 | |
109 | |
110 set(ORTHANC_UNIT_TESTS_SOURCES | |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
111 UnitTestsSources/DatabaseLookupTests.cpp |
2691 | 112 UnitTestsSources/DicomMapTests.cpp |
113 UnitTestsSources/FileStorageTests.cpp | |
114 UnitTestsSources/FromDcmtkTests.cpp | |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
115 UnitTestsSources/ImageProcessingTests.cpp |
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
116 UnitTestsSources/ImageTests.cpp |
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
117 UnitTestsSources/JpegLosslessTests.cpp |
3353
54cdad5a7228
Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
3333
diff
changeset
|
118 UnitTestsSources/LoggingTests.cpp |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
119 UnitTestsSources/LuaTests.cpp |
2691 | 120 UnitTestsSources/MemoryCacheTests.cpp |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
121 UnitTestsSources/MultiThreadingTests.cpp |
2691 | 122 UnitTestsSources/RestApiTests.cpp |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
123 UnitTestsSources/SQLiteChromiumTests.cpp |
2691 | 124 UnitTestsSources/SQLiteTests.cpp |
125 UnitTestsSources/ServerIndexTests.cpp | |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
126 UnitTestsSources/StreamTests.cpp |
3326
b21d4cc8e5d1
speed up base64 decoding + added tests
Alain Mazy <alain@mazy.be>
parents:
3295
diff
changeset
|
127 UnitTestsSources/ToolboxTests.cpp |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
128 UnitTestsSources/UnitTestsMain.cpp |
2691 | 129 UnitTestsSources/VersionsTests.cpp |
130 UnitTestsSources/ZipTests.cpp | |
131 ) | |
132 | |
133 | |
134 if (ENABLE_PLUGINS) | |
3074
495c5edce708
new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3071
diff
changeset
|
135 include_directories(${CMAKE_SOURCE_DIR}/Plugins/Include) |
495c5edce708
new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3071
diff
changeset
|
136 |
2691 | 137 list(APPEND ORTHANC_SERVER_SOURCES |
138 Plugins/Engine/OrthancPluginDatabase.cpp | |
139 Plugins/Engine/OrthancPlugins.cpp | |
140 Plugins/Engine/PluginsEnumerations.cpp | |
141 Plugins/Engine/PluginsErrorDictionary.cpp | |
2808
37583cd183ed
primitives to create jobs from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2773
diff
changeset
|
142 Plugins/Engine/PluginsJob.cpp |
2691 | 143 Plugins/Engine/PluginsManager.cpp |
144 ) | |
145 | |
146 list(APPEND ORTHANC_UNIT_TESTS_SOURCES | |
147 UnitTestsSources/PluginsTests.cpp | |
148 ) | |
149 endif() | |
150 | |
151 | |
152 if (CMAKE_COMPILER_IS_GNUCXX | |
153 AND NOT CMAKE_CROSSCOMPILING | |
3275 | 154 AND DCMTK_STATIC_VERSION STREQUAL "3.6.0") |
2691 | 155 # Add the "-pedantic" flag only on the Orthanc sources, and only if |
156 # cross-compiling DCMTK 3.6.0 | |
157 set(ORTHANC_ALL_SOURCES | |
158 ${ORTHANC_CORE_SOURCES_INTERNAL} | |
159 ${ORTHANC_DICOM_SOURCES_INTERNAL} | |
160 ${ORTHANC_SERVER_SOURCES} | |
161 ${ORTHANC_UNIT_TESTS_SOURCES} | |
162 Plugins/Samples/ServeFolders/Plugin.cpp | |
163 Plugins/Samples/ModalityWorklists/Plugin.cpp | |
164 OrthancServer/main.cpp | |
165 ) | |
166 | |
167 set_source_files_properties(${ORTHANC_ALL_SOURCES} | |
168 PROPERTIES COMPILE_FLAGS -pedantic | |
169 ) | |
170 endif() | |
171 | |
172 | |
173 ##################################################################### | |
174 ## Autogeneration of files | |
175 ##################################################################### | |
176 | |
177 set(ORTHANC_EMBEDDED_FILES | |
3094
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
178 CONFIGURATION_SAMPLE ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Configuration.json |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
179 DICOM_CONFORMANCE_STATEMENT ${CMAKE_CURRENT_SOURCE_DIR}/Resources/DicomConformanceStatement.txt |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
180 FONT_UBUNTU_MONO_BOLD_16 ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Fonts/UbuntuMonoBold-16.json |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
181 LUA_TOOLBOX ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Toolbox.lua |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
182 PREPARE_DATABASE ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Database/PrepareDatabase.sql |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
183 UPGRADE_DATABASE_3_TO_4 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Database/Upgrade3To4.sql |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
184 UPGRADE_DATABASE_4_TO_5 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Database/Upgrade4To5.sql |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
185 |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
186 INSTALL_TRACK_ATTACHMENTS_SIZE |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
187 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Database/InstallTrackAttachmentsSize.sql |
2691 | 188 ) |
189 | |
190 if (STANDALONE_BUILD) | |
191 # We embed all the resources in the binaries for standalone builds | |
192 add_definitions(-DORTHANC_STANDALONE=1) | |
193 EmbedResources( | |
194 ${ORTHANC_EMBEDDED_FILES} | |
195 ORTHANC_EXPLORER ${CMAKE_CURRENT_SOURCE_DIR}/OrthancExplorer | |
196 ${DCMTK_DICTIONARIES} | |
3333
2a38e00a0638
Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3326
diff
changeset
|
197 ${LIBICU_RESOURCES} |
2691 | 198 ) |
199 else() | |
200 add_definitions( | |
201 -DORTHANC_STANDALONE=0 | |
202 -DORTHANC_PATH=\"${CMAKE_SOURCE_DIR}\" | |
203 ) | |
204 EmbedResources( | |
205 ${ORTHANC_EMBEDDED_FILES} | |
3333
2a38e00a0638
Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3326
diff
changeset
|
206 ${LIBICU_RESOURCES} |
2691 | 207 ) |
208 endif() | |
209 | |
210 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
211 execute_process( | |
212 COMMAND | |
213 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py | |
214 ${ORTHANC_VERSION} Orthanc Orthanc.exe "Lightweight, RESTful DICOM server for medical imaging" | |
215 ERROR_VARIABLE Failure | |
216 OUTPUT_FILE ${AUTOGENERATED_DIR}/Orthanc.rc | |
217 ) | |
218 | |
219 if (Failure) | |
220 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
221 endif() | |
222 | |
223 list(APPEND ORTHANC_RESOURCES ${AUTOGENERATED_DIR}/Orthanc.rc) | |
224 endif() | |
225 | |
226 | |
227 | |
228 ##################################################################### | |
229 ## Configuration of the C/C++ macros | |
230 ##################################################################### | |
231 | |
232 if (ENABLE_PLUGINS) | |
233 add_definitions(-DORTHANC_ENABLE_PLUGINS=1) | |
234 else() | |
235 add_definitions(-DORTHANC_ENABLE_PLUGINS=0) | |
236 endif() | |
237 | |
238 | |
239 if (UNIT_TESTS_WITH_HTTP_CONNEXIONS) | |
240 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1) | |
241 else() | |
242 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0) | |
243 endif() | |
244 | |
245 | |
246 add_definitions( | |
247 -DORTHANC_BUILD_UNIT_TESTS=1 | |
248 -DORTHANC_ENABLE_LOGGING_PLUGIN=0 | |
249 | |
250 # Macros for the plugins | |
251 -DHAS_ORTHANC_EXCEPTION=0 | |
252 -DMODALITY_WORKLISTS_VERSION="${ORTHANC_VERSION}" | |
253 -DSERVE_FOLDERS_VERSION="${ORTHANC_VERSION}" | |
254 ) | |
255 | |
256 | |
257 # Setup precompiled headers for Microsoft Visual Studio | |
258 | |
259 # WARNING: There must be NO MORE "add_definitions()", "include()" or | |
260 # "include_directories()" below, otherwise the generated precompiled | |
261 # headers might get broken! | |
262 | |
263 if (MSVC) | |
264 add_definitions(-DORTHANC_USE_PRECOMPILED_HEADERS=1) | |
265 | |
266 set(TMP | |
267 ${ORTHANC_CORE_SOURCES_INTERNAL} | |
268 ${ORTHANC_DICOM_SOURCES_INTERNAL} | |
269 ) | |
270 | |
271 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS( | |
272 "PrecompiledHeaders.h" "Core/PrecompiledHeaders.cpp" | |
273 TMP ORTHANC_CORE_PCH) | |
274 | |
275 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS( | |
276 "PrecompiledHeadersServer.h" "OrthancServer/PrecompiledHeadersServer.cpp" | |
277 ORTHANC_SERVER_SOURCES ORTHANC_SERVER_PCH) | |
278 | |
279 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS( | |
280 "PrecompiledHeadersUnitTests.h" "UnitTestsSources/PrecompiledHeadersUnitTests.cpp" | |
281 ORTHANC_UNIT_TESTS_SOURCES ORTHANC_UNIT_TESTS_PCH) | |
282 endif() | |
283 | |
284 | |
285 | |
286 ##################################################################### | |
287 ## Build the core of Orthanc | |
288 ##################################################################### | |
289 | |
290 # "CoreLibrary" contains all the third-party dependencies and the | |
291 # content of the "Core" folder | |
292 add_library(CoreLibrary | |
293 STATIC | |
294 ${ORTHANC_CORE_PCH} | |
295 ${ORTHANC_CORE_SOURCES} | |
296 ${ORTHANC_DICOM_SOURCES} | |
297 ${AUTOGENERATED_SOURCES} | |
3270 | 298 ) |
299 | |
300 if (LIBICU_LIBRARIES) | |
301 target_link_libraries(CoreLibrary ${LIBICU_LIBRARIES}) | |
302 endif() | |
2691 | 303 |
304 | |
305 ##################################################################### | |
306 ## Build the Orthanc server | |
307 ##################################################################### | |
308 | |
309 add_library(ServerLibrary | |
310 STATIC | |
311 ${ORTHANC_SERVER_PCH} | |
312 ${ORTHANC_SERVER_SOURCES} | |
313 ) | |
314 | |
315 # Ensure autogenerated code is built before building ServerLibrary | |
316 add_dependencies(ServerLibrary CoreLibrary) | |
317 | |
318 add_executable(Orthanc | |
319 OrthancServer/main.cpp | |
320 ${ORTHANC_RESOURCES} | |
321 ) | |
322 | |
323 target_link_libraries(Orthanc ServerLibrary CoreLibrary ${DCMTK_LIBRARIES}) | |
324 | |
325 install( | |
326 TARGETS Orthanc | |
327 RUNTIME DESTINATION sbin | |
328 ) | |
329 | |
330 | |
331 ##################################################################### | |
332 ## Build the unit tests | |
333 ##################################################################### | |
334 | |
335 add_executable(UnitTests | |
336 ${GOOGLE_TEST_SOURCES} | |
337 ${ORTHANC_UNIT_TESTS_PCH} | |
338 ${ORTHANC_UNIT_TESTS_SOURCES} | |
3326
b21d4cc8e5d1
speed up base64 decoding + added tests
Alain Mazy <alain@mazy.be>
parents:
3295
diff
changeset
|
339 ${BOOST_EXTENDED_SOURCES} |
2691 | 340 ) |
341 | |
342 target_link_libraries(UnitTests | |
343 ServerLibrary | |
344 CoreLibrary | |
345 ${DCMTK_LIBRARIES} | |
346 ${GOOGLE_TEST_LIBRARIES} | |
347 ) | |
348 | |
349 | |
350 ##################################################################### | |
3233
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
351 ## Build a static library to share code between the plugins |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
352 ##################################################################### |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
353 |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
354 if (ENABLE_PLUGINS AND |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
355 (BUILD_SERVE_FOLDERS OR BUILD_MODALITY_WORKLISTS)) |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
356 add_library(ThirdPartyPlugins STATIC |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
357 ${BOOST_SOURCES} |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
358 ${JSONCPP_SOURCES} |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
359 ${LIBICONV_SOURCES} |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
360 ${LIBICU_SOURCES} |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
361 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
362 ) |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
363 |
3271 | 364 if (LIBICU_LIBRARIES) |
365 target_link_libraries(ThirdPartyPlugins ${LIBICU_LIBRARIES}) | |
366 endif() | |
367 | |
3233
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
368 # Add the "-fPIC" option as this static library must be embedded |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
369 # inside shared libraries (important on UNIX) |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
370 set_property( |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
371 TARGET ThirdPartyPlugins |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
372 PROPERTY POSITION_INDEPENDENT_CODE ON |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
373 ) |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
374 endif() |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
375 |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
376 |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
377 ##################################################################### |
2691 | 378 ## Build the "ServeFolders" plugin |
379 ##################################################################### | |
380 | |
381 if (ENABLE_PLUGINS AND BUILD_SERVE_FOLDERS) | |
382 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
383 execute_process( | |
384 COMMAND | |
385 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py | |
386 ${ORTHANC_VERSION} ServeFolders ServeFolders.dll "Orthanc plugin to serve additional folders" | |
387 ERROR_VARIABLE Failure | |
388 OUTPUT_FILE ${AUTOGENERATED_DIR}/ServeFolders.rc | |
389 ) | |
390 | |
391 if (Failure) | |
392 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
393 endif() | |
394 | |
395 list(APPEND SERVE_FOLDERS_RESOURCES ${AUTOGENERATED_DIR}/ServeFolders.rc) | |
396 endif() | |
397 | |
398 add_library(ServeFolders SHARED | |
399 Plugins/Samples/ServeFolders/Plugin.cpp | |
400 ${SERVE_FOLDERS_RESOURCES} | |
401 ) | |
402 | |
3233
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
403 target_link_libraries(ServeFolders ThirdPartyPlugins) |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
404 |
2691 | 405 set_target_properties( |
406 ServeFolders PROPERTIES | |
407 VERSION ${ORTHANC_VERSION} | |
408 SOVERSION ${ORTHANC_VERSION} | |
409 ) | |
410 | |
411 install( | |
412 TARGETS ServeFolders | |
413 RUNTIME DESTINATION lib # Destination for Windows | |
414 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
415 ) | |
416 endif() | |
417 | |
418 | |
419 | |
420 ##################################################################### | |
421 ## Build the "ModalityWorklists" plugin | |
422 ##################################################################### | |
423 | |
424 if (ENABLE_PLUGINS AND BUILD_MODALITY_WORKLISTS) | |
425 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
426 execute_process( | |
427 COMMAND | |
428 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py | |
429 ${ORTHANC_VERSION} ModalityWorklists ModalityWorklists.dll "Sample Orthanc plugin to serve modality worklists" | |
430 ERROR_VARIABLE Failure | |
431 OUTPUT_FILE ${AUTOGENERATED_DIR}/ModalityWorklists.rc | |
432 ) | |
433 | |
434 if (Failure) | |
435 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
436 endif() | |
437 | |
438 list(APPEND MODALITY_WORKLISTS_RESOURCES ${AUTOGENERATED_DIR}/ModalityWorklists.rc) | |
439 endif() | |
440 | |
441 add_library(ModalityWorklists SHARED | |
442 Plugins/Samples/ModalityWorklists/Plugin.cpp | |
443 ${MODALITY_WORKLISTS_RESOURCES} | |
444 ) | |
445 | |
3233
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
446 target_link_libraries(ModalityWorklists ThirdPartyPlugins) |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
447 |
2691 | 448 set_target_properties( |
449 ModalityWorklists PROPERTIES | |
450 VERSION ${ORTHANC_VERSION} | |
451 SOVERSION ${ORTHANC_VERSION} | |
452 ) | |
453 | |
454 install( | |
455 TARGETS ModalityWorklists | |
456 RUNTIME DESTINATION lib # Destination for Windows | |
457 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
458 ) | |
459 endif() | |
460 | |
461 | |
462 | |
463 ##################################################################### | |
464 ## Build the companion tool to recover files compressed using Orthanc | |
465 ##################################################################### | |
466 | |
467 if (BUILD_RECOVER_COMPRESSED_FILE) | |
468 set(RECOVER_COMPRESSED_SOURCES | |
469 Resources/Samples/Tools/RecoverCompressedFile.cpp | |
470 ) | |
471 | |
472 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
473 execute_process( | |
474 COMMAND | |
475 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py | |
476 ${ORTHANC_VERSION} OrthancRecoverCompressedFile OrthancRecoverCompressedFile.exe | |
477 "Lightweight, RESTful DICOM server for medical imaging" | |
478 ERROR_VARIABLE Failure | |
479 OUTPUT_FILE ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc | |
480 ) | |
481 | |
482 if (Failure) | |
483 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
484 endif() | |
485 | |
486 list(APPEND RECOVER_COMPRESSED_SOURCES | |
487 ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc | |
488 ) | |
489 endif() | |
490 | |
491 add_executable(OrthancRecoverCompressedFile ${RECOVER_COMPRESSED_SOURCES}) | |
492 | |
493 target_link_libraries(OrthancRecoverCompressedFile CoreLibrary) | |
494 | |
495 install( | |
496 TARGETS OrthancRecoverCompressedFile | |
497 RUNTIME DESTINATION bin | |
498 ) | |
499 endif() | |
500 | |
501 | |
502 | |
503 ##################################################################### | |
504 ## Generate the documentation if Doxygen is present | |
505 ##################################################################### | |
506 | |
507 find_package(Doxygen) | |
508 if (DOXYGEN_FOUND) | |
509 configure_file( | |
510 ${CMAKE_SOURCE_DIR}/Resources/Orthanc.doxygen | |
511 ${CMAKE_CURRENT_BINARY_DIR}/Orthanc.doxygen | |
512 @ONLY) | |
513 | |
514 configure_file( | |
515 ${CMAKE_SOURCE_DIR}/Resources/OrthancPlugin.doxygen | |
516 ${CMAKE_CURRENT_BINARY_DIR}/OrthancPlugin.doxygen | |
517 @ONLY) | |
518 | |
519 add_custom_target(doc | |
520 ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Orthanc.doxygen | |
521 COMMENT "Generating internal documentation with Doxygen" VERBATIM | |
522 ) | |
523 | |
524 add_custom_command(TARGET Orthanc | |
525 POST_BUILD | |
526 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/OrthancPlugin.doxygen | |
527 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | |
528 COMMENT "Generating plugin documentation with Doxygen" VERBATIM | |
529 ) | |
530 | |
531 install( | |
532 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/OrthancPluginDocumentation/doc/ | |
533 DESTINATION share/doc/orthanc/OrthancPlugin | |
534 ) | |
535 else() | |
536 message("Doxygen not found. The documentation will not be built.") | |
537 endif() | |
538 | |
539 | |
540 | |
541 ##################################################################### | |
542 ## Install the plugin SDK | |
543 ##################################################################### | |
544 | |
545 if (ENABLE_PLUGINS) | |
546 install( | |
547 FILES | |
548 Plugins/Include/orthanc/OrthancCPlugin.h | |
549 Plugins/Include/orthanc/OrthancCDatabasePlugin.h | |
550 DESTINATION include/orthanc | |
551 ) | |
552 endif() | |
553 | |
554 | |
555 | |
556 ##################################################################### | |
557 ## Prepare the "uninstall" target | |
558 ## http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F | |
559 ##################################################################### | |
560 | |
561 configure_file( | |
562 "${CMAKE_CURRENT_SOURCE_DIR}/Resources/CMake/Uninstall.cmake.in" | |
563 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" | |
564 IMMEDIATE @ONLY) | |
565 | |
566 add_custom_target(uninstall | |
567 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) |