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