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