Mercurial > hg > orthanc
annotate CMakeLists.txt @ 3954:67b457283499 c-get
coding style
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 20 May 2020 09:52:20 +0200 |
parents | 82e88ff003d7 |
children | 596912ebab5f |
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) | |
3893 | 16 set(ENABLE_DCMTK_TRANSCODING ON) |
2691 | 17 set(ENABLE_GOOGLE_TEST ON) |
18 set(ENABLE_JPEG ON) | |
19 set(ENABLE_LOCALE ON) | |
20 set(ENABLE_LUA ON) | |
3723
cc6d4edfe8fe
fix pkcs11 compilation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3633
diff
changeset
|
21 set(ENABLE_OPENSSL_ENGINES ON) # OpenSSL engines are necessary for PKCS11 |
2691 | 22 set(ENABLE_PNG ON) |
23 set(ENABLE_PUGIXML ON) | |
24 set(ENABLE_SQLITE ON) | |
25 set(ENABLE_WEB_CLIENT ON) | |
26 set(ENABLE_WEB_SERVER ON) | |
27 set(ENABLE_ZLIB ON) | |
28 | |
29 set(HAS_EMBEDDED_RESOURCES ON) | |
30 | |
31 | |
32 ##################################################################### | |
33 ## CMake parameters tunable at the command line to configure the | |
34 ## plugins, the companion tools, and the unit tests | |
35 ##################################################################### | |
36 | |
37 # Parameters of the build | |
38 SET(BUILD_MODALITY_WORKLISTS ON CACHE BOOL "Whether to build the sample plugin to serve modality worklists") | |
39 SET(BUILD_RECOVER_COMPRESSED_FILE ON CACHE BOOL "Whether to build the companion tool to recover files compressed using Orthanc") | |
40 SET(BUILD_SERVE_FOLDERS ON CACHE BOOL "Whether to build the ServeFolders plugin") | |
3622
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
41 SET(BUILD_CONNECTIVITY_CHECKS ON CACHE BOOL "Whether to build the ConnectivityChecks plugin") |
2691 | 42 SET(ENABLE_PLUGINS ON CACHE BOOL "Enable plugins") |
43 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests") | |
44 | |
45 | |
46 ##################################################################### | |
47 ## Configuration of the Orthanc framework | |
48 ##################################################################### | |
49 | |
50 include(${CMAKE_SOURCE_DIR}/Resources/CMake/VisualStudioPrecompiledHeaders.cmake) | |
51 include(${CMAKE_SOURCE_DIR}/Resources/CMake/OrthancFrameworkConfiguration.cmake) | |
52 | |
53 | |
54 ##################################################################### | |
55 ## List of source files | |
56 ##################################################################### | |
57 | |
58 set(ORTHANC_SERVER_SOURCES | |
3093
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3091
diff
changeset
|
59 OrthancServer/Database/Compatibility/DatabaseLookup.cpp |
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3091
diff
changeset
|
60 OrthancServer/Database/Compatibility/ICreateInstance.cpp |
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3091
diff
changeset
|
61 OrthancServer/Database/Compatibility/IGetChildrenMetadata.cpp |
3187
4bbadcd03966
refactoring retrieval of metadata from database
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3095
diff
changeset
|
62 OrthancServer/Database/Compatibility/ILookupResourceAndParent.cpp |
3093
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3091
diff
changeset
|
63 OrthancServer/Database/Compatibility/ILookupResources.cpp |
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3091
diff
changeset
|
64 OrthancServer/Database/Compatibility/SetOfResources.cpp |
3094
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
65 OrthancServer/Database/ResourcesContent.cpp |
3093
2e1808b6146a
reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3091
diff
changeset
|
66 OrthancServer/Database/SQLiteDatabaseWrapper.cpp |
2691 | 67 OrthancServer/DicomInstanceOrigin.cpp |
68 OrthancServer/DicomInstanceToStore.cpp | |
69 OrthancServer/ExportedResource.cpp | |
70 OrthancServer/LuaScripting.cpp | |
2933
4a38d7d4f0e0
new class: OrthancConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2893
diff
changeset
|
71 OrthancServer/OrthancConfiguration.cpp |
2691 | 72 OrthancServer/OrthancFindRequestHandler.cpp |
73 OrthancServer/OrthancHttpHandler.cpp | |
74 OrthancServer/OrthancInitialization.cpp | |
75 OrthancServer/OrthancMoveRequestHandler.cpp | |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3746
diff
changeset
|
76 OrthancServer/OrthancGetRequestHandler.cpp |
2691 | 77 OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp |
78 OrthancServer/OrthancRestApi/OrthancRestApi.cpp | |
79 OrthancServer/OrthancRestApi/OrthancRestArchive.cpp | |
80 OrthancServer/OrthancRestApi/OrthancRestChanges.cpp | |
81 OrthancServer/OrthancRestApi/OrthancRestModalities.cpp | |
82 OrthancServer/OrthancRestApi/OrthancRestResources.cpp | |
83 OrthancServer/OrthancRestApi/OrthancRestSystem.cpp | |
84 OrthancServer/QueryRetrieveHandler.cpp | |
3029
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3018
diff
changeset
|
85 OrthancServer/Search/DatabaseConstraint.cpp |
2892
ce310baccda6
DicomTagConstraint and DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
86 OrthancServer/Search/DatabaseLookup.cpp |
ce310baccda6
DicomTagConstraint and DatabaseLookup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2867
diff
changeset
|
87 OrthancServer/Search/DicomTagConstraint.cpp |
2691 | 88 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
|
89 OrthancServer/Search/ISqlLookupFormatter.cpp |
2691 | 90 OrthancServer/ServerContext.cpp |
91 OrthancServer/ServerEnumerations.cpp | |
92 OrthancServer/ServerIndex.cpp | |
93 OrthancServer/ServerJobs/ArchiveJob.cpp | |
94 OrthancServer/ServerJobs/DicomModalityStoreJob.cpp | |
2867 | 95 OrthancServer/ServerJobs/DicomMoveScuJob.cpp |
2691 | 96 OrthancServer/ServerJobs/LuaJobManager.cpp |
2853
52b017d22a4f
New URI: "/studies/.../merge" to merge a study
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2844
diff
changeset
|
97 OrthancServer/ServerJobs/MergeStudyJob.cpp |
2691 | 98 OrthancServer/ServerJobs/Operations/DeleteResourceOperation.cpp |
3095
beeeb6096f27
removing dependencies upon ServerContext
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3094
diff
changeset
|
99 OrthancServer/ServerJobs/Operations/DicomInstanceOperationValue.cpp |
2691 | 100 OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.cpp |
101 OrthancServer/ServerJobs/Operations/StorePeerOperation.cpp | |
102 OrthancServer/ServerJobs/Operations/StoreScuOperation.cpp | |
103 OrthancServer/ServerJobs/Operations/SystemCallOperation.cpp | |
104 OrthancServer/ServerJobs/OrthancJobUnserializer.cpp | |
105 OrthancServer/ServerJobs/OrthancPeerStoreJob.cpp | |
106 OrthancServer/ServerJobs/ResourceModificationJob.cpp | |
2844
99863d6245b2
New URI: "/studies/.../split" to split a study
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2808
diff
changeset
|
107 OrthancServer/ServerJobs/SplitStudyJob.cpp |
3636 | 108 OrthancServer/ServerJobs/StorageCommitmentScpJob.cpp |
2691 | 109 OrthancServer/ServerToolbox.cpp |
110 OrthancServer/SliceOrdering.cpp | |
3736
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3731
diff
changeset
|
111 OrthancServer/StorageCommitmentReports.cpp |
2691 | 112 ) |
113 | |
114 | |
115 set(ORTHANC_UNIT_TESTS_SOURCES | |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
116 UnitTestsSources/DatabaseLookupTests.cpp |
2691 | 117 UnitTestsSources/DicomMapTests.cpp |
118 UnitTestsSources/FileStorageTests.cpp | |
119 UnitTestsSources/FromDcmtkTests.cpp | |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
120 UnitTestsSources/ImageProcessingTests.cpp |
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
121 UnitTestsSources/ImageTests.cpp |
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
122 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
|
123 UnitTestsSources/LoggingTests.cpp |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
124 UnitTestsSources/LuaTests.cpp |
2691 | 125 UnitTestsSources/MemoryCacheTests.cpp |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
126 UnitTestsSources/MultiThreadingTests.cpp |
2691 | 127 UnitTestsSources/RestApiTests.cpp |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
128 UnitTestsSources/SQLiteChromiumTests.cpp |
2691 | 129 UnitTestsSources/SQLiteTests.cpp |
130 UnitTestsSources/ServerIndexTests.cpp | |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
131 UnitTestsSources/StreamTests.cpp |
3326
b21d4cc8e5d1
speed up base64 decoding + added tests
Alain Mazy <alain@mazy.be>
parents:
3295
diff
changeset
|
132 UnitTestsSources/ToolboxTests.cpp |
2893
1723cbba55c7
testing DicomTagConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2892
diff
changeset
|
133 UnitTestsSources/UnitTestsMain.cpp |
2691 | 134 UnitTestsSources/VersionsTests.cpp |
135 UnitTestsSources/ZipTests.cpp | |
136 ) | |
137 | |
138 | |
139 if (ENABLE_PLUGINS) | |
3074
495c5edce708
new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3071
diff
changeset
|
140 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
|
141 |
2691 | 142 list(APPEND ORTHANC_SERVER_SOURCES |
143 Plugins/Engine/OrthancPluginDatabase.cpp | |
144 Plugins/Engine/OrthancPlugins.cpp | |
145 Plugins/Engine/PluginsEnumerations.cpp | |
146 Plugins/Engine/PluginsErrorDictionary.cpp | |
2808
37583cd183ed
primitives to create jobs from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2773
diff
changeset
|
147 Plugins/Engine/PluginsJob.cpp |
2691 | 148 Plugins/Engine/PluginsManager.cpp |
149 ) | |
150 | |
151 list(APPEND ORTHANC_UNIT_TESTS_SOURCES | |
152 UnitTestsSources/PluginsTests.cpp | |
153 ) | |
154 endif() | |
155 | |
156 | |
157 if (CMAKE_COMPILER_IS_GNUCXX | |
158 AND NOT CMAKE_CROSSCOMPILING | |
3275 | 159 AND DCMTK_STATIC_VERSION STREQUAL "3.6.0") |
2691 | 160 # Add the "-pedantic" flag only on the Orthanc sources, and only if |
161 # cross-compiling DCMTK 3.6.0 | |
162 set(ORTHANC_ALL_SOURCES | |
163 ${ORTHANC_CORE_SOURCES_INTERNAL} | |
164 ${ORTHANC_DICOM_SOURCES_INTERNAL} | |
165 ${ORTHANC_SERVER_SOURCES} | |
166 ${ORTHANC_UNIT_TESTS_SOURCES} | |
167 Plugins/Samples/ServeFolders/Plugin.cpp | |
168 Plugins/Samples/ModalityWorklists/Plugin.cpp | |
169 OrthancServer/main.cpp | |
170 ) | |
171 | |
172 set_source_files_properties(${ORTHANC_ALL_SOURCES} | |
173 PROPERTIES COMPILE_FLAGS -pedantic | |
174 ) | |
175 endif() | |
176 | |
177 | |
178 ##################################################################### | |
179 ## Autogeneration of files | |
180 ##################################################################### | |
181 | |
182 set(ORTHANC_EMBEDDED_FILES | |
3094
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
183 CONFIGURATION_SAMPLE ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Configuration.json |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
184 DICOM_CONFORMANCE_STATEMENT ${CMAKE_CURRENT_SOURCE_DIR}/Resources/DicomConformanceStatement.txt |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
185 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
|
186 LUA_TOOLBOX ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Toolbox.lua |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
187 PREPARE_DATABASE ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Database/PrepareDatabase.sql |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
188 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
|
189 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
|
190 |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
191 INSTALL_TRACK_ATTACHMENTS_SIZE |
61da3c9b4121
cont reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3093
diff
changeset
|
192 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Database/InstallTrackAttachmentsSize.sql |
2691 | 193 ) |
194 | |
195 if (STANDALONE_BUILD) | |
196 # We embed all the resources in the binaries for standalone builds | |
197 add_definitions(-DORTHANC_STANDALONE=1) | |
198 EmbedResources( | |
199 ${ORTHANC_EMBEDDED_FILES} | |
200 ORTHANC_EXPLORER ${CMAKE_CURRENT_SOURCE_DIR}/OrthancExplorer | |
201 ${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
|
202 ${LIBICU_RESOURCES} |
2691 | 203 ) |
204 else() | |
205 add_definitions( | |
206 -DORTHANC_STANDALONE=0 | |
207 -DORTHANC_PATH=\"${CMAKE_SOURCE_DIR}\" | |
208 ) | |
209 EmbedResources( | |
210 ${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
|
211 ${LIBICU_RESOURCES} |
2691 | 212 ) |
213 endif() | |
214 | |
215 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
216 execute_process( | |
217 COMMAND | |
218 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py | |
219 ${ORTHANC_VERSION} Orthanc Orthanc.exe "Lightweight, RESTful DICOM server for medical imaging" | |
220 ERROR_VARIABLE Failure | |
221 OUTPUT_FILE ${AUTOGENERATED_DIR}/Orthanc.rc | |
222 ) | |
223 | |
224 if (Failure) | |
225 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
226 endif() | |
227 | |
228 list(APPEND ORTHANC_RESOURCES ${AUTOGENERATED_DIR}/Orthanc.rc) | |
229 endif() | |
230 | |
231 | |
232 | |
233 ##################################################################### | |
234 ## Configuration of the C/C++ macros | |
235 ##################################################################### | |
236 | |
237 if (ENABLE_PLUGINS) | |
238 add_definitions(-DORTHANC_ENABLE_PLUGINS=1) | |
239 else() | |
240 add_definitions(-DORTHANC_ENABLE_PLUGINS=0) | |
241 endif() | |
242 | |
243 | |
244 if (UNIT_TESTS_WITH_HTTP_CONNEXIONS) | |
245 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1) | |
246 else() | |
247 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0) | |
248 endif() | |
249 | |
250 | |
251 add_definitions( | |
252 -DORTHANC_BUILD_UNIT_TESTS=1 | |
253 -DORTHANC_ENABLE_LOGGING_PLUGIN=0 | |
254 | |
255 # Macros for the plugins | |
256 -DHAS_ORTHANC_EXCEPTION=0 | |
257 -DMODALITY_WORKLISTS_VERSION="${ORTHANC_VERSION}" | |
258 -DSERVE_FOLDERS_VERSION="${ORTHANC_VERSION}" | |
259 ) | |
260 | |
261 | |
262 # Setup precompiled headers for Microsoft Visual Studio | |
263 | |
264 # WARNING: There must be NO MORE "add_definitions()", "include()" or | |
265 # "include_directories()" below, otherwise the generated precompiled | |
266 # headers might get broken! | |
267 | |
268 if (MSVC) | |
269 add_definitions(-DORTHANC_USE_PRECOMPILED_HEADERS=1) | |
270 | |
271 set(TMP | |
272 ${ORTHANC_CORE_SOURCES_INTERNAL} | |
273 ${ORTHANC_DICOM_SOURCES_INTERNAL} | |
274 ) | |
275 | |
276 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS( | |
277 "PrecompiledHeaders.h" "Core/PrecompiledHeaders.cpp" | |
278 TMP ORTHANC_CORE_PCH) | |
279 | |
280 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS( | |
281 "PrecompiledHeadersServer.h" "OrthancServer/PrecompiledHeadersServer.cpp" | |
282 ORTHANC_SERVER_SOURCES ORTHANC_SERVER_PCH) | |
283 | |
284 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS( | |
285 "PrecompiledHeadersUnitTests.h" "UnitTestsSources/PrecompiledHeadersUnitTests.cpp" | |
286 ORTHANC_UNIT_TESTS_SOURCES ORTHANC_UNIT_TESTS_PCH) | |
287 endif() | |
288 | |
289 | |
290 | |
291 ##################################################################### | |
292 ## Build the core of Orthanc | |
293 ##################################################################### | |
294 | |
295 # "CoreLibrary" contains all the third-party dependencies and the | |
296 # content of the "Core" folder | |
297 add_library(CoreLibrary | |
298 STATIC | |
299 ${ORTHANC_CORE_PCH} | |
300 ${ORTHANC_CORE_SOURCES} | |
301 ${ORTHANC_DICOM_SOURCES} | |
302 ${AUTOGENERATED_SOURCES} | |
3270 | 303 ) |
304 | |
305 if (LIBICU_LIBRARIES) | |
306 target_link_libraries(CoreLibrary ${LIBICU_LIBRARIES}) | |
307 endif() | |
2691 | 308 |
309 | |
310 ##################################################################### | |
311 ## Build the Orthanc server | |
312 ##################################################################### | |
313 | |
314 add_library(ServerLibrary | |
315 STATIC | |
316 ${ORTHANC_SERVER_PCH} | |
317 ${ORTHANC_SERVER_SOURCES} | |
318 ) | |
319 | |
320 # Ensure autogenerated code is built before building ServerLibrary | |
321 add_dependencies(ServerLibrary CoreLibrary) | |
322 | |
323 add_executable(Orthanc | |
324 OrthancServer/main.cpp | |
325 ${ORTHANC_RESOURCES} | |
326 ) | |
327 | |
328 target_link_libraries(Orthanc ServerLibrary CoreLibrary ${DCMTK_LIBRARIES}) | |
329 | |
330 install( | |
331 TARGETS Orthanc | |
332 RUNTIME DESTINATION sbin | |
333 ) | |
334 | |
335 | |
336 ##################################################################### | |
337 ## Build the unit tests | |
338 ##################################################################### | |
339 | |
340 add_executable(UnitTests | |
341 ${GOOGLE_TEST_SOURCES} | |
342 ${ORTHANC_UNIT_TESTS_PCH} | |
343 ${ORTHANC_UNIT_TESTS_SOURCES} | |
3326
b21d4cc8e5d1
speed up base64 decoding + added tests
Alain Mazy <alain@mazy.be>
parents:
3295
diff
changeset
|
344 ${BOOST_EXTENDED_SOURCES} |
2691 | 345 ) |
346 | |
347 target_link_libraries(UnitTests | |
348 ServerLibrary | |
349 CoreLibrary | |
350 ${DCMTK_LIBRARIES} | |
351 ${GOOGLE_TEST_LIBRARIES} | |
352 ) | |
353 | |
354 | |
355 ##################################################################### | |
3233
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
356 ## 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
|
357 ##################################################################### |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
358 |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
359 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
|
360 (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
|
361 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
|
362 ${BOOST_SOURCES} |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
363 ${JSONCPP_SOURCES} |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
364 ${LIBICONV_SOURCES} |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
365 ${LIBICU_SOURCES} |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
366 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
|
367 ) |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
368 |
3271 | 369 if (LIBICU_LIBRARIES) |
370 target_link_libraries(ThirdPartyPlugins ${LIBICU_LIBRARIES}) | |
371 endif() | |
372 | |
3233
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
373 # 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
|
374 # 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
|
375 set_property( |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
376 TARGET ThirdPartyPlugins |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
377 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
|
378 ) |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
379 endif() |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
380 |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
381 |
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
382 ##################################################################### |
2691 | 383 ## Build the "ServeFolders" plugin |
384 ##################################################################### | |
385 | |
386 if (ENABLE_PLUGINS AND BUILD_SERVE_FOLDERS) | |
387 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
388 execute_process( | |
389 COMMAND | |
390 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py | |
391 ${ORTHANC_VERSION} ServeFolders ServeFolders.dll "Orthanc plugin to serve additional folders" | |
392 ERROR_VARIABLE Failure | |
393 OUTPUT_FILE ${AUTOGENERATED_DIR}/ServeFolders.rc | |
394 ) | |
395 | |
396 if (Failure) | |
397 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
398 endif() | |
399 | |
400 list(APPEND SERVE_FOLDERS_RESOURCES ${AUTOGENERATED_DIR}/ServeFolders.rc) | |
401 endif() | |
402 | |
403 add_library(ServeFolders SHARED | |
404 Plugins/Samples/ServeFolders/Plugin.cpp | |
405 ${SERVE_FOLDERS_RESOURCES} | |
406 ) | |
407 | |
3233
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
408 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
|
409 |
2691 | 410 set_target_properties( |
411 ServeFolders PROPERTIES | |
412 VERSION ${ORTHANC_VERSION} | |
413 SOVERSION ${ORTHANC_VERSION} | |
414 ) | |
415 | |
416 install( | |
417 TARGETS ServeFolders | |
418 RUNTIME DESTINATION lib # Destination for Windows | |
419 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
420 ) | |
421 endif() | |
422 | |
423 | |
424 | |
425 ##################################################################### | |
426 ## Build the "ModalityWorklists" plugin | |
427 ##################################################################### | |
428 | |
429 if (ENABLE_PLUGINS AND BUILD_MODALITY_WORKLISTS) | |
430 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
431 execute_process( | |
432 COMMAND | |
433 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py | |
434 ${ORTHANC_VERSION} ModalityWorklists ModalityWorklists.dll "Sample Orthanc plugin to serve modality worklists" | |
435 ERROR_VARIABLE Failure | |
436 OUTPUT_FILE ${AUTOGENERATED_DIR}/ModalityWorklists.rc | |
437 ) | |
438 | |
439 if (Failure) | |
440 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
441 endif() | |
442 | |
443 list(APPEND MODALITY_WORKLISTS_RESOURCES ${AUTOGENERATED_DIR}/ModalityWorklists.rc) | |
444 endif() | |
445 | |
446 add_library(ModalityWorklists SHARED | |
447 Plugins/Samples/ModalityWorklists/Plugin.cpp | |
448 ${MODALITY_WORKLISTS_RESOURCES} | |
449 ) | |
450 | |
3233
47fbb0467a62
Build a static library to share code between the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3187
diff
changeset
|
451 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
|
452 |
2691 | 453 set_target_properties( |
454 ModalityWorklists PROPERTIES | |
455 VERSION ${ORTHANC_VERSION} | |
456 SOVERSION ${ORTHANC_VERSION} | |
457 ) | |
458 | |
459 install( | |
460 TARGETS ModalityWorklists | |
461 RUNTIME DESTINATION lib # Destination for Windows | |
462 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
463 ) | |
464 endif() | |
465 | |
466 | |
467 | |
468 ##################################################################### | |
3622
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
469 ## Build the "ConnectivityChecks" plugin |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
470 ##################################################################### |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
471 |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
472 if (ENABLE_PLUGINS AND BUILD_CONNECTIVITY_CHECKS) |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
473 include(ExternalProject) |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
474 |
3625 | 475 set(Flags) |
3627
b03854e0f796
trying to fix output folders for OS X and windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3626
diff
changeset
|
476 |
3622
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
477 if (CMAKE_TOOLCHAIN_FILE) |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
478 # Take absolute path to the toolchain |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
479 get_filename_component(TMP ${CMAKE_TOOLCHAIN_FILE} REALPATH BASE ${CMAKE_SOURCE_DIR}) |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
480 list(APPEND Flags -DCMAKE_TOOLCHAIN_FILE=${TMP}) |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
481 endif() |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
482 |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
483 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
484 list(APPEND Flags |
3625 | 485 -DLSB_CC=${CMAKE_LSB_CC} |
486 -DLSB_CXX=${CMAKE_LSB_CXX} | |
3622
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
487 ) |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
488 endif() |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
489 |
3637
06eb59faf4da
use a shorter path for VS2008
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3636
diff
changeset
|
490 externalproject_add(ConnectivityChecks |
3622
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
491 SOURCE_DIR "${ORTHANC_ROOT}/Plugins/Samples/ConnectivityChecks" |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
492 |
3637
06eb59faf4da
use a shorter path for VS2008
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3636
diff
changeset
|
493 # We explicitly provide a build directory, in order to avoid paths |
06eb59faf4da
use a shorter path for VS2008
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3636
diff
changeset
|
494 # that are too long on our Visual Studio 2008 CIS |
06eb59faf4da
use a shorter path for VS2008
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3636
diff
changeset
|
495 BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/ConnectivityChecks-build" |
06eb59faf4da
use a shorter path for VS2008
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3636
diff
changeset
|
496 |
3622
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
497 CMAKE_ARGS |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
498 -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} |
3623 | 499 -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR} |
3622
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
500 -DPLUGIN_VERSION=${ORTHANC_VERSION} |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
501 -DSTATIC_BUILD=${STATIC_BUILD} |
3625 | 502 -DALLOW_DOWNLOADS=${ALLOW_DOWNLOADS} |
3622
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
503 -DUSE_LEGACY_JSONCPP=${USE_LEGACY_JSONCPP} |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
504 ${Flags} |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
505 ) |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
506 |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
507 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
508 if (MSVC) |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
509 set(Prefix "") |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
510 else() |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
511 set(Prefix "lib") # MinGW |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
512 endif() |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
513 |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
514 install(FILES |
3633
5295a49dd78a
removing not working tricks for ConnectivityChecks plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3628
diff
changeset
|
515 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}ConnectivityChecks.dll |
3622
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
516 DESTINATION "lib") |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
517 else() |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
518 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
519 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix) |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
520 install(FILES |
3633
5295a49dd78a
removing not working tricks for ConnectivityChecks plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3628
diff
changeset
|
521 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}ConnectivityChecks${Suffix} |
5295a49dd78a
removing not working tricks for ConnectivityChecks plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3628
diff
changeset
|
522 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}ConnectivityChecks${Suffix}.${ORTHANC_VERSION} |
3622
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
523 DESTINATION "share/orthanc/plugins") |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
524 endif() |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
525 endif() |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
526 |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
527 |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
528 |
8afc14fab01f
New sample plugin: ConnectivityChecks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3353
diff
changeset
|
529 ##################################################################### |
2691 | 530 ## Build the companion tool to recover files compressed using Orthanc |
531 ##################################################################### | |
532 | |
533 if (BUILD_RECOVER_COMPRESSED_FILE) | |
534 set(RECOVER_COMPRESSED_SOURCES | |
535 Resources/Samples/Tools/RecoverCompressedFile.cpp | |
536 ) | |
537 | |
538 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
539 execute_process( | |
540 COMMAND | |
541 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py | |
542 ${ORTHANC_VERSION} OrthancRecoverCompressedFile OrthancRecoverCompressedFile.exe | |
543 "Lightweight, RESTful DICOM server for medical imaging" | |
544 ERROR_VARIABLE Failure | |
545 OUTPUT_FILE ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc | |
546 ) | |
547 | |
548 if (Failure) | |
549 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
550 endif() | |
551 | |
552 list(APPEND RECOVER_COMPRESSED_SOURCES | |
553 ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc | |
554 ) | |
555 endif() | |
556 | |
557 add_executable(OrthancRecoverCompressedFile ${RECOVER_COMPRESSED_SOURCES}) | |
558 | |
559 target_link_libraries(OrthancRecoverCompressedFile CoreLibrary) | |
560 | |
561 install( | |
562 TARGETS OrthancRecoverCompressedFile | |
563 RUNTIME DESTINATION bin | |
564 ) | |
565 endif() | |
566 | |
567 | |
568 | |
569 ##################################################################### | |
570 ## Generate the documentation if Doxygen is present | |
571 ##################################################################### | |
572 | |
573 find_package(Doxygen) | |
574 if (DOXYGEN_FOUND) | |
575 configure_file( | |
576 ${CMAKE_SOURCE_DIR}/Resources/Orthanc.doxygen | |
577 ${CMAKE_CURRENT_BINARY_DIR}/Orthanc.doxygen | |
578 @ONLY) | |
579 | |
580 configure_file( | |
581 ${CMAKE_SOURCE_DIR}/Resources/OrthancPlugin.doxygen | |
582 ${CMAKE_CURRENT_BINARY_DIR}/OrthancPlugin.doxygen | |
583 @ONLY) | |
584 | |
585 add_custom_target(doc | |
586 ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Orthanc.doxygen | |
587 COMMENT "Generating internal documentation with Doxygen" VERBATIM | |
588 ) | |
589 | |
590 add_custom_command(TARGET Orthanc | |
591 POST_BUILD | |
592 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/OrthancPlugin.doxygen | |
593 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | |
594 COMMENT "Generating plugin documentation with Doxygen" VERBATIM | |
595 ) | |
596 | |
597 install( | |
598 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/OrthancPluginDocumentation/doc/ | |
599 DESTINATION share/doc/orthanc/OrthancPlugin | |
600 ) | |
601 else() | |
602 message("Doxygen not found. The documentation will not be built.") | |
603 endif() | |
604 | |
605 | |
606 | |
607 ##################################################################### | |
608 ## Install the plugin SDK | |
609 ##################################################################### | |
610 | |
611 if (ENABLE_PLUGINS) | |
612 install( | |
613 FILES | |
614 Plugins/Include/orthanc/OrthancCPlugin.h | |
615 Plugins/Include/orthanc/OrthancCDatabasePlugin.h | |
616 DESTINATION include/orthanc | |
617 ) | |
618 endif() | |
619 | |
620 | |
621 | |
622 ##################################################################### | |
623 ## Prepare the "uninstall" target | |
624 ## http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F | |
625 ##################################################################### | |
626 | |
627 configure_file( | |
628 "${CMAKE_CURRENT_SOURCE_DIR}/Resources/CMake/Uninstall.cmake.in" | |
629 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" | |
630 IMMEDIATE @ONLY) | |
631 | |
632 add_custom_target(uninstall | |
633 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) |