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