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