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