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