annotate CMakeLists.txt @ 2729:fab6b36cdec0 jobs

closing branch jobs
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 13 Jul 2018 10:08:18 +0200
parents 8e593bd59cf7
children bb63068844ae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2691
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
1 cmake_minimum_required(VERSION 2.8)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
3 project(Orthanc)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
5
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
6 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
7 ## Generic parameters of the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
8 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
9
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
10 include(${CMAKE_SOURCE_DIR}/Resources/CMake/OrthancFrameworkParameters.cmake)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
11
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
12 # Enable all the optional components of the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
13 set(ENABLE_CRYPTO_OPTIONS ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
14 set(ENABLE_DCMTK ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
15 set(ENABLE_DCMTK_NETWORKING ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
16 set(ENABLE_GOOGLE_TEST ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
17 set(ENABLE_JPEG ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
18 set(ENABLE_LOCALE ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
19 set(ENABLE_LUA ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
20 set(ENABLE_PNG ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
21 set(ENABLE_PUGIXML ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
22 set(ENABLE_SQLITE ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
23 set(ENABLE_WEB_CLIENT ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
24 set(ENABLE_WEB_SERVER ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
25 set(ENABLE_ZLIB ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
26
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
27 set(HAS_EMBEDDED_RESOURCES ON)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
28
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
29
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
30 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
31 ## CMake parameters tunable at the command line to configure the
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
32 ## plugins, the companion tools, and the unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
33 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
34
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
35 # Parameters of the build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
36 SET(BUILD_MODALITY_WORKLISTS ON CACHE BOOL "Whether to build the sample plugin to serve modality worklists")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
37 SET(BUILD_RECOVER_COMPRESSED_FILE ON CACHE BOOL "Whether to build the companion tool to recover files compressed using Orthanc")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
38 SET(BUILD_SERVE_FOLDERS ON CACHE BOOL "Whether to build the ServeFolders plugin")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
39 SET(ENABLE_PLUGINS ON CACHE BOOL "Enable plugins")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
40 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
41
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
42
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
43 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
44 ## Configuration of the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
45 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
46
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
47 include(${CMAKE_SOURCE_DIR}/Resources/CMake/VisualStudioPrecompiledHeaders.cmake)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
48 include(${CMAKE_SOURCE_DIR}/Resources/CMake/OrthancFrameworkConfiguration.cmake)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
49
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
50
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
51 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
52 ## List of source files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
53 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
54
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
55 set(ORTHANC_SERVER_SOURCES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
56 OrthancServer/DatabaseWrapper.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
57 OrthancServer/DatabaseWrapperBase.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
58 OrthancServer/DicomInstanceOrigin.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
59 OrthancServer/DicomInstanceToStore.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
60 OrthancServer/ExportedResource.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
61 OrthancServer/LuaScripting.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
62 OrthancServer/OrthancFindRequestHandler.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
63 OrthancServer/OrthancHttpHandler.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
64 OrthancServer/OrthancInitialization.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
65 OrthancServer/OrthancMoveRequestHandler.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
66 OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
67 OrthancServer/OrthancRestApi/OrthancRestApi.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
68 OrthancServer/OrthancRestApi/OrthancRestArchive.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
69 OrthancServer/OrthancRestApi/OrthancRestChanges.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
70 OrthancServer/OrthancRestApi/OrthancRestModalities.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
71 OrthancServer/OrthancRestApi/OrthancRestResources.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
72 OrthancServer/OrthancRestApi/OrthancRestSystem.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
73 OrthancServer/QueryRetrieveHandler.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
74 OrthancServer/Search/HierarchicalMatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
75 OrthancServer/Search/IFindConstraint.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
76 OrthancServer/Search/ListConstraint.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
77 OrthancServer/Search/LookupIdentifierQuery.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
78 OrthancServer/Search/LookupResource.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
79 OrthancServer/Search/RangeConstraint.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
80 OrthancServer/Search/SetOfResources.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
81 OrthancServer/Search/ValueConstraint.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
82 OrthancServer/Search/WildcardConstraint.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
83 OrthancServer/ServerContext.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
84 OrthancServer/ServerEnumerations.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
85 OrthancServer/ServerIndex.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
86 OrthancServer/ServerJobs/ArchiveJob.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
87 OrthancServer/ServerJobs/DicomModalityStoreJob.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
88 OrthancServer/ServerJobs/LuaJobManager.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
89 OrthancServer/ServerJobs/Operations/DeleteResourceOperation.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
90 OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
91 OrthancServer/ServerJobs/Operations/StorePeerOperation.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
92 OrthancServer/ServerJobs/Operations/StoreScuOperation.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
93 OrthancServer/ServerJobs/Operations/SystemCallOperation.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
94 OrthancServer/ServerJobs/OrthancJobUnserializer.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
95 OrthancServer/ServerJobs/OrthancPeerStoreJob.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
96 OrthancServer/ServerJobs/ResourceModificationJob.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
97 OrthancServer/ServerToolbox.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
98 OrthancServer/SliceOrdering.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
99 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
100
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
101
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
102 set(ORTHANC_UNIT_TESTS_SOURCES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
103 UnitTestsSources/DicomMapTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
104 UnitTestsSources/FileStorageTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
105 UnitTestsSources/FromDcmtkTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
106 UnitTestsSources/MemoryCacheTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
107 UnitTestsSources/ImageTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
108 UnitTestsSources/RestApiTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
109 UnitTestsSources/SQLiteTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
110 UnitTestsSources/SQLiteChromiumTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
111 UnitTestsSources/ServerIndexTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
112 UnitTestsSources/VersionsTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
113 UnitTestsSources/ZipTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
114 UnitTestsSources/LuaTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
115 UnitTestsSources/MultiThreadingTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
116 UnitTestsSources/UnitTestsMain.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
117 UnitTestsSources/ImageProcessingTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
118 UnitTestsSources/JpegLosslessTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
119 UnitTestsSources/StreamTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
120 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
121
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
122
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
123 if (ENABLE_PLUGINS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
124 list(APPEND ORTHANC_SERVER_SOURCES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
125 Plugins/Engine/OrthancPluginDatabase.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
126 Plugins/Engine/OrthancPlugins.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
127 Plugins/Engine/PluginsEnumerations.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
128 Plugins/Engine/PluginsErrorDictionary.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
129 Plugins/Engine/PluginsManager.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
130 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
131
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
132 list(APPEND ORTHANC_UNIT_TESTS_SOURCES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
133 UnitTestsSources/PluginsTests.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
134 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
135 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
136
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
137
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
138 if (CMAKE_COMPILER_IS_GNUCXX
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
139 AND NOT CMAKE_CROSSCOMPILING
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
140 AND USE_DCMTK_360)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
141 # Add the "-pedantic" flag only on the Orthanc sources, and only if
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
142 # cross-compiling DCMTK 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
143 set(ORTHANC_ALL_SOURCES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
144 ${ORTHANC_CORE_SOURCES_INTERNAL}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
145 ${ORTHANC_DICOM_SOURCES_INTERNAL}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
146 ${ORTHANC_SERVER_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
147 ${ORTHANC_UNIT_TESTS_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
148 Plugins/Samples/ServeFolders/Plugin.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
149 Plugins/Samples/ModalityWorklists/Plugin.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
150 OrthancServer/main.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
151 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
152
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
153 set_source_files_properties(${ORTHANC_ALL_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
154 PROPERTIES COMPILE_FLAGS -pedantic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
155 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
156 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
157
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
158
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
159 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
160 ## Autogeneration of files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
161 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
162
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
163 set(ORTHANC_EMBEDDED_FILES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
164 PREPARE_DATABASE ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/PrepareDatabase.sql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
165 UPGRADE_DATABASE_3_TO_4 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Upgrade3To4.sql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
166 UPGRADE_DATABASE_4_TO_5 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Upgrade4To5.sql
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
167 CONFIGURATION_SAMPLE ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Configuration.json
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
168 DICOM_CONFORMANCE_STATEMENT ${CMAKE_CURRENT_SOURCE_DIR}/Resources/DicomConformanceStatement.txt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
169 LUA_TOOLBOX ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Toolbox.lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
170 FONT_UBUNTU_MONO_BOLD_16 ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Fonts/UbuntuMonoBold-16.json
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
171 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
172
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
173 if (STANDALONE_BUILD)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
174 # We embed all the resources in the binaries for standalone builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
175 add_definitions(-DORTHANC_STANDALONE=1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
176 EmbedResources(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
177 ${ORTHANC_EMBEDDED_FILES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
178 ORTHANC_EXPLORER ${CMAKE_CURRENT_SOURCE_DIR}/OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
179 ${DCMTK_DICTIONARIES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
180 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
181 else()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
182 add_definitions(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
183 -DORTHANC_STANDALONE=0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
184 -DORTHANC_PATH=\"${CMAKE_SOURCE_DIR}\"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
185 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
186 EmbedResources(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
187 ${ORTHANC_EMBEDDED_FILES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
188 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
189 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
190
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
191 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
192 execute_process(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
193 COMMAND
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
194 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
195 ${ORTHANC_VERSION} Orthanc Orthanc.exe "Lightweight, RESTful DICOM server for medical imaging"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
196 ERROR_VARIABLE Failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
197 OUTPUT_FILE ${AUTOGENERATED_DIR}/Orthanc.rc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
198 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
199
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
200 if (Failure)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
201 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
202 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
203
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
204 list(APPEND ORTHANC_RESOURCES ${AUTOGENERATED_DIR}/Orthanc.rc)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
205 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
206
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
207
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
208
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
209 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
210 ## Configuration of the C/C++ macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
211 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
212
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
213 if (ENABLE_PLUGINS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
214 add_definitions(-DORTHANC_ENABLE_PLUGINS=1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
215 else()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
216 add_definitions(-DORTHANC_ENABLE_PLUGINS=0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
217 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
218
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
219
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
220 if (UNIT_TESTS_WITH_HTTP_CONNEXIONS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
221 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
222 else()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
223 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
224 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
225
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
226
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
227 include_directories(${CMAKE_SOURCE_DIR}/Plugins/Include)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
228
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
229 add_definitions(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
230 -DORTHANC_BUILD_UNIT_TESTS=1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
231 -DORTHANC_ENABLE_LOGGING_PLUGIN=0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
232
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
233 # Macros for the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
234 -DHAS_ORTHANC_EXCEPTION=0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
235 -DMODALITY_WORKLISTS_VERSION="${ORTHANC_VERSION}"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
236 -DSERVE_FOLDERS_VERSION="${ORTHANC_VERSION}"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
237 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
238
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
239
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
240 # Setup precompiled headers for Microsoft Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
241
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
242 # WARNING: There must be NO MORE "add_definitions()", "include()" or
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
243 # "include_directories()" below, otherwise the generated precompiled
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
244 # headers might get broken!
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
245
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
246 if (MSVC)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
247 add_definitions(-DORTHANC_USE_PRECOMPILED_HEADERS=1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
248
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
249 set(TMP
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
250 ${ORTHANC_CORE_SOURCES_INTERNAL}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
251 ${ORTHANC_DICOM_SOURCES_INTERNAL}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
252 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
253
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
254 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
255 "PrecompiledHeaders.h" "Core/PrecompiledHeaders.cpp"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
256 TMP ORTHANC_CORE_PCH)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
257
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
258 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
259 "PrecompiledHeadersServer.h" "OrthancServer/PrecompiledHeadersServer.cpp"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
260 ORTHANC_SERVER_SOURCES ORTHANC_SERVER_PCH)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
261
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
262 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
263 "PrecompiledHeadersUnitTests.h" "UnitTestsSources/PrecompiledHeadersUnitTests.cpp"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
264 ORTHANC_UNIT_TESTS_SOURCES ORTHANC_UNIT_TESTS_PCH)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
265 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
266
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
267
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
268
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
269 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
270 ## Build the core of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
271 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
272
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
273 # "CoreLibrary" contains all the third-party dependencies and the
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
274 # content of the "Core" folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
275 add_library(CoreLibrary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
276 STATIC
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
277 ${ORTHANC_CORE_PCH}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
278 ${ORTHANC_CORE_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
279 ${ORTHANC_DICOM_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
280 ${AUTOGENERATED_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
281 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
282
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
283
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
284 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
285 ## Build the Orthanc server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
286 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
287
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
288 add_library(ServerLibrary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
289 STATIC
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
290 ${ORTHANC_SERVER_PCH}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
291 ${ORTHANC_SERVER_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
292 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
293
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
294 # Ensure autogenerated code is built before building ServerLibrary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
295 add_dependencies(ServerLibrary CoreLibrary)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
296
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
297 add_executable(Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
298 OrthancServer/main.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
299 ${ORTHANC_RESOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
300 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
301
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
302 target_link_libraries(Orthanc ServerLibrary CoreLibrary ${DCMTK_LIBRARIES})
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
303
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
304 install(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
305 TARGETS Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
306 RUNTIME DESTINATION sbin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
307 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
308
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
309
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
310 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
311 ## Build the unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
312 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
313
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
314 add_executable(UnitTests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
315 ${GOOGLE_TEST_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
316 ${ORTHANC_UNIT_TESTS_PCH}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
317 ${ORTHANC_UNIT_TESTS_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
318 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
319
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
320 target_link_libraries(UnitTests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
321 ServerLibrary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
322 CoreLibrary
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
323 ${DCMTK_LIBRARIES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
324 ${GOOGLE_TEST_LIBRARIES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
325 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
326
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
327
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
328 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
329 ## Build the "ServeFolders" plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
330 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
331
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
332 if (ENABLE_PLUGINS AND BUILD_SERVE_FOLDERS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
333 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
334 execute_process(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
335 COMMAND
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
336 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
337 ${ORTHANC_VERSION} ServeFolders ServeFolders.dll "Orthanc plugin to serve additional folders"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
338 ERROR_VARIABLE Failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
339 OUTPUT_FILE ${AUTOGENERATED_DIR}/ServeFolders.rc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
340 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
341
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
342 if (Failure)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
343 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
344 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
345
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
346 list(APPEND SERVE_FOLDERS_RESOURCES ${AUTOGENERATED_DIR}/ServeFolders.rc)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
347 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
348
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
349 add_library(ServeFolders SHARED
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
350 ${BOOST_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
351 ${JSONCPP_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
352 ${LIBICONV_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
353 Plugins/Samples/ServeFolders/Plugin.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
354 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
355 ${SERVE_FOLDERS_RESOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
356 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
357
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
358 set_target_properties(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
359 ServeFolders PROPERTIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
360 VERSION ${ORTHANC_VERSION}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
361 SOVERSION ${ORTHANC_VERSION}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
362 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
363
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
364 install(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
365 TARGETS ServeFolders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
366 RUNTIME DESTINATION lib # Destination for Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
367 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
368 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
369 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
370
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
371
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
372
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
373 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
374 ## Build the "ModalityWorklists" plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
375 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
376
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
377 if (ENABLE_PLUGINS AND BUILD_MODALITY_WORKLISTS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
378 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
379 execute_process(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
380 COMMAND
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
381 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
382 ${ORTHANC_VERSION} ModalityWorklists ModalityWorklists.dll "Sample Orthanc plugin to serve modality worklists"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
383 ERROR_VARIABLE Failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
384 OUTPUT_FILE ${AUTOGENERATED_DIR}/ModalityWorklists.rc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
385 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
386
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
387 if (Failure)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
388 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
389 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
390
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
391 list(APPEND MODALITY_WORKLISTS_RESOURCES ${AUTOGENERATED_DIR}/ModalityWorklists.rc)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
392 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
393
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
394 add_library(ModalityWorklists SHARED
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
395 ${BOOST_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
396 ${JSONCPP_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
397 ${LIBICONV_SOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
398 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
399 Plugins/Samples/ModalityWorklists/Plugin.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
400 ${MODALITY_WORKLISTS_RESOURCES}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
401 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
402
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
403 set_target_properties(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
404 ModalityWorklists PROPERTIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
405 VERSION ${ORTHANC_VERSION}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
406 SOVERSION ${ORTHANC_VERSION}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
407 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
408
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
409 install(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
410 TARGETS ModalityWorklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
411 RUNTIME DESTINATION lib # Destination for Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
412 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
413 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
414 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
415
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
416
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
417
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
418 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
419 ## Build the companion tool to recover files compressed using Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
420 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
421
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
422 if (BUILD_RECOVER_COMPRESSED_FILE)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
423 set(RECOVER_COMPRESSED_SOURCES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
424 Resources/Samples/Tools/RecoverCompressedFile.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
425 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
426
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
427 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
428 execute_process(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
429 COMMAND
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
430 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
431 ${ORTHANC_VERSION} OrthancRecoverCompressedFile OrthancRecoverCompressedFile.exe
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
432 "Lightweight, RESTful DICOM server for medical imaging"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
433 ERROR_VARIABLE Failure
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
434 OUTPUT_FILE ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
435 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
436
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
437 if (Failure)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
438 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
439 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
440
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
441 list(APPEND RECOVER_COMPRESSED_SOURCES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
442 ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
443 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
444 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
445
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
446 add_executable(OrthancRecoverCompressedFile ${RECOVER_COMPRESSED_SOURCES})
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
447
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
448 target_link_libraries(OrthancRecoverCompressedFile CoreLibrary)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
449
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
450 install(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
451 TARGETS OrthancRecoverCompressedFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
452 RUNTIME DESTINATION bin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
453 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
454 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
455
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
456
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
457
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
458 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
459 ## Generate the documentation if Doxygen is present
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
460 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
461
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
462 find_package(Doxygen)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
463 if (DOXYGEN_FOUND)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
464 configure_file(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
465 ${CMAKE_SOURCE_DIR}/Resources/Orthanc.doxygen
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
466 ${CMAKE_CURRENT_BINARY_DIR}/Orthanc.doxygen
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
467 @ONLY)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
468
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
469 configure_file(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
470 ${CMAKE_SOURCE_DIR}/Resources/OrthancPlugin.doxygen
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
471 ${CMAKE_CURRENT_BINARY_DIR}/OrthancPlugin.doxygen
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
472 @ONLY)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
473
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
474 add_custom_target(doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
475 ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Orthanc.doxygen
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
476 COMMENT "Generating internal documentation with Doxygen" VERBATIM
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
477 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
478
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
479 add_custom_command(TARGET Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
480 POST_BUILD
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
481 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/OrthancPlugin.doxygen
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
482 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
483 COMMENT "Generating plugin documentation with Doxygen" VERBATIM
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
484 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
485
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
486 install(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
487 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/OrthancPluginDocumentation/doc/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
488 DESTINATION share/doc/orthanc/OrthancPlugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
489 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
490 else()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
491 message("Doxygen not found. The documentation will not be built.")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
492 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
493
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
494
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
495
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
496 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
497 ## Install the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
498 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
499
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
500 if (ENABLE_PLUGINS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
501 install(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
502 FILES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
503 Plugins/Include/orthanc/OrthancCPlugin.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
504 Plugins/Include/orthanc/OrthancCDatabasePlugin.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
505 DESTINATION include/orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
506 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
507 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
508
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
509
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
510
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
511 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
512 ## Prepare the "uninstall" target
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
513 ## http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
514 #####################################################################
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
515
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
516 configure_file(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
517 "${CMAKE_CURRENT_SOURCE_DIR}/Resources/CMake/Uninstall.cmake.in"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
518 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
519 IMMEDIATE @ONLY)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
520
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
521 add_custom_target(uninstall
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2642
diff changeset
522 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)