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