comparison Resources/CMake/OrthancStone.cmake @ 113:2eca030792aa wasm

using the Orthanc Framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 20 Sep 2017 15:32:32 +0200
parents 7665ccbf33db
children 3541fc81331a
comparison
equal deleted inserted replaced
112:948f86e61e83 113:2eca030792aa
15 # 15 #
16 # You should have received a copy of the GNU Affero General Public License 16 # You should have received a copy of the GNU Affero General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. 17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 18
19 19
20 # Version of the build, should always be "mainline" except in release branches 20
21 set(ORTHANC_STONE_VERSION "mainline") 21 #####################################################################
22 22 ## Import the parameters of the Orthanc Framework
23 ##################################################################### 23 #####################################################################
24 ## Parameters of the build 24
25 ##################################################################### 25 # TODO => Import
26 26 SET(ORTHANC_ROOT /home/jodogne/Subversion/orthanc)
27 # Generic parameters 27
28 SET(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") 28 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake)
29 SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages") 29
30 SET(STONE_SANDBOXED OFF CACHE BOOL "Whether Stone runs inside a sandboxed environment (such as Google NaCl)") 30 # Optional components of the Orthanc Framework
31 SET(ENABLE_PROFILING OFF CACHE BOOL "Whether to enable the generation of profiling information with gprof")
32
33 # Optional components
34 SET(ENABLE_CURL ON CACHE BOOL "Include support for libcurl") 31 SET(ENABLE_CURL ON CACHE BOOL "Include support for libcurl")
35 SET(ENABLE_SSL OFF CACHE BOOL "Include support for SSL") 32 SET(ENABLE_SSL OFF CACHE BOOL "Include support for SSL")
33 SET(ENABLE_LOGGING ON CACHE BOOL "Enable logging facilities from Orthanc")
34
35
36
37 #####################################################################
38 ## Parameters of the Stone of Orthanc
39 #####################################################################
40
41 # Generic parameters
42 SET(STONE_SANDBOXED OFF CACHE BOOL "Whether Stone runs inside a sandboxed environment (such as Google NaCl or WebAssembly)")
43
44 # Optional components of Stone
36 SET(ENABLE_SDL ON CACHE BOOL "Include support for SDL") 45 SET(ENABLE_SDL ON CACHE BOOL "Include support for SDL")
37 SET(ENABLE_LOGGING ON CACHE BOOL "Enable logging facilities from Orthanc")
38 46
39 # Advanced parameters to fine-tune linking against system libraries 47 # Advanced parameters to fine-tune linking against system libraries
40 SET(USE_SYSTEM_BOOST ON CACHE BOOL "Use the system version of Boost")
41 SET(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp")
42 SET(USE_SYSTEM_ZLIB ON CACHE BOOL "Use the system version of ZLib")
43 SET(USE_SYSTEM_CAIRO ON CACHE BOOL "Use the system version of Cairo") 48 SET(USE_SYSTEM_CAIRO ON CACHE BOOL "Use the system version of Cairo")
44 SET(USE_SYSTEM_PIXMAN ON CACHE BOOL "Use the system version of Pixman") 49 SET(USE_SYSTEM_PIXMAN ON CACHE BOOL "Use the system version of Pixman")
45 SET(USE_SYSTEM_LIBPNG ON CACHE BOOL "Use the system version of libpng")
46 SET(USE_SYSTEM_LIBJPEG ON CACHE BOOL "Use the system version of libjpeg")
47 SET(USE_SYSTEM_CURL ON CACHE BOOL "Use the system version of LibCurl")
48 SET(USE_SYSTEM_OPENSSL ON CACHE BOOL "Use the system version of OpenSSL")
49 SET(USE_SYSTEM_SDL ON CACHE BOOL "Use the system version of SDL2") 50 SET(USE_SYSTEM_SDL ON CACHE BOOL "Use the system version of SDL2")
50 51
51 52
52 ##################################################################### 53 #####################################################################
54 ## Configure the Orthanc Framework
55 #####################################################################
56
57 if (NOT STONE_SANDBOXED)
58 SET(ORTHANC_BOOST_COMPONENTS program_options)
59 SET(ENABLE_CURL ON)
60 SET(ENABLE_CRYPTO_OPTIONS ON)
61 SET(ENABLE_WEB_CLIENT ON)
62 endif()
63
64 SET(ENABLE_GOOGLE_TEST ON)
65 SET(ENABLE_JPEG ON)
66 SET(ENABLE_PNG ON)
67
68 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake)
69
70 include_directories(${ORTHANC_ROOT})
71
72
73 #####################################################################
53 ## Configure mandatory third-party components 74 ## Configure mandatory third-party components
54 ##################################################################### 75 #####################################################################
55 76
56 SET(ORTHANC_STONE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) 77 SET(ORTHANC_STONE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
57 SET(ORTHANC_ROOT ${ORTHANC_STONE_DIR}/Resources/Orthanc) 78
58
59 include(CheckIncludeFiles)
60 include(CheckIncludeFileCXX)
61 include(CheckLibraryExists)
62 include(FindPythonInterp)
63 include(FindPkgConfig) 79 include(FindPkgConfig)
64
65 include(${ORTHANC_ROOT}/Resources/CMake/Compiler.cmake)
66 include(${ORTHANC_ROOT}/Resources/CMake/AutoGeneratedCode.cmake)
67 include(${ORTHANC_ROOT}/Resources/CMake/DownloadPackage.cmake)
68
69 include(${ORTHANC_ROOT}/Resources/CMake/JsonCppConfiguration.cmake)
70 include(${ORTHANC_ROOT}/Resources/CMake/ZlibConfiguration.cmake)
71 include(${ORTHANC_ROOT}/Resources/CMake/LibPngConfiguration.cmake)
72 include(${ORTHANC_ROOT}/Resources/CMake/LibJpegConfiguration.cmake)
73
74 include(${CMAKE_CURRENT_LIST_DIR}/BoostExtendedConfiguration.cmake) 80 include(${CMAKE_CURRENT_LIST_DIR}/BoostExtendedConfiguration.cmake)
75 include(${CMAKE_CURRENT_LIST_DIR}/CairoConfiguration.cmake) 81 include(${CMAKE_CURRENT_LIST_DIR}/CairoConfiguration.cmake)
76 include(${CMAKE_CURRENT_LIST_DIR}/PixmanConfiguration.cmake) 82 include(${CMAKE_CURRENT_LIST_DIR}/PixmanConfiguration.cmake)
77 83
78 if (MSVC) 84 if (MSVC)
84 ##################################################################### 90 #####################################################################
85 ## Configure optional third-party components 91 ## Configure optional third-party components
86 ##################################################################### 92 #####################################################################
87 93
88 if (STONE_SANDBOXED) 94 if (STONE_SANDBOXED)
95 if (ENABLE_CURL)
96 message(FATAL_ERROR "Cannot enable curl in sandboxed environments")
97 endif()
98
99 if (ENABLE_LOGGING)
100 message(FATAL_ERROR "Cannot enable logging in sandboxed environments")
101 endif()
102
103 if (ENABLE_SDL)
104 message(FATAL_ERROR "Cannot enable SDL in sandboxed environments")
105 endif()
106
107 if (ENABLE_SSL)
108 message(FATAL_ERROR "Cannot enable SSL in sandboxed environments")
109 endif()
110
89 add_definitions( 111 add_definitions(
90 -DORTHANC_ENABLE_CURL=0
91 -DORTHANC_ENABLE_LOGGING=0
92 -DORTHANC_ENABLE_SDL=0
93 -DORTHANC_ENABLE_SSL=0
94 -DORTHANC_SANDBOXED=1 112 -DORTHANC_SANDBOXED=1
95 ) 113 )
114
96 else() 115 else()
97 list(APPEND ORTHANC_STONE_SOURCES 116 list(APPEND ORTHANC_STONE_SOURCES
98 ${ORTHANC_ROOT}/Core/HttpClient.cpp
99 ${ORTHANC_ROOT}/Core/SystemToolbox.cpp
100 ${ORTHANC_ROOT}/Plugins/Samples/Common/OrthancHttpConnection.cpp 117 ${ORTHANC_ROOT}/Plugins/Samples/Common/OrthancHttpConnection.cpp
101 ) 118 )
102 119
103 add_definitions( 120 add_definitions(
104 -DORTHANC_SANDBOXED=0 121 -DORTHANC_SANDBOXED=0
105 -DORTHANC_ENABLE_LOGGING_PLUGIN=0 122 )
106 ) 123 endif()
107 124
108 if (ENABLE_LOGGING) 125
109 add_definitions(-DORTHANC_ENABLE_LOGGING=1) 126 if (ENABLE_SDL)
110 else() 127 include(${CMAKE_CURRENT_LIST_DIR}/SdlConfiguration.cmake)
111 add_definitions(-DORTHANC_ENABLE_LOGGING=0) 128 add_definitions(-DORTHANC_ENABLE_SDL=1)
112 endif() 129 else()
113 130 add_definitions(-DORTHANC_ENABLE_SDL=0)
114 if (ENABLE_SDL) 131 endif()
115 include(${CMAKE_CURRENT_LIST_DIR}/SdlConfiguration.cmake) 132
116 add_definitions(-DORTHANC_ENABLE_SDL=1)
117 else()
118 add_definitions(-DORTHANC_ENABLE_SDL=0)
119 endif()
120
121 if (ENABLE_CURL)
122 add_definitions(-DORTHANC_ENABLE_CURL=1)
123 include(${ORTHANC_ROOT}/Resources/CMake/LibCurlConfiguration.cmake)
124
125 if (ENABLE_SSL)
126 set(ENABLE_PKCS11 OFF)
127 add_definitions(-DORTHANC_ENABLE_SSL=1)
128 include(${ORTHANC_ROOT}/Resources/CMake/OpenSslConfiguration.cmake)
129 else()
130 add_definitions(-DORTHANC_ENABLE_SSL=0)
131 endif()
132 else()
133 add_definitions(
134 -DORTHANC_ENABLE_SSL=0
135 -DORTHANC_ENABLE_CURL=0
136 )
137 endif()
138 endif()
139 133
140 add_definitions( 134 add_definitions(
141 -DHAS_ORTHANC_EXCEPTION=1 135 -DHAS_ORTHANC_EXCEPTION=1
142 -DORTHANC_ENABLE_MD5=0 136 -DORTHANC_ENABLE_LOGGING_PLUGIN=0
143 -DORTHANC_ENABLE_BASE64=1
144 -DORTHANC_ENABLE_PUGIXML=0
145 -DORTHANC_ENABLE_PKCS11=0
146 ) 137 )
147 138
148 139
149 ##################################################################### 140
150 ## Link the colormaps into the binaries 141
142 #####################################################################
143 ## Embed the colormaps into the binaries
151 ##################################################################### 144 #####################################################################
152 145
153 EmbedResources( 146 EmbedResources(
154 COLORMAP_HOT ${ORTHANC_STONE_DIR}/Resources/Colormaps/hot.lut 147 COLORMAP_HOT ${ORTHANC_STONE_DIR}/Resources/Colormaps/hot.lut
155 COLORMAP_JET ${ORTHANC_STONE_DIR}/Resources/Colormaps/jet.lut 148 COLORMAP_JET ${ORTHANC_STONE_DIR}/Resources/Colormaps/jet.lut
157 COLORMAP_GREEN ${ORTHANC_STONE_DIR}/Resources/Colormaps/green.lut 150 COLORMAP_GREEN ${ORTHANC_STONE_DIR}/Resources/Colormaps/green.lut
158 COLORMAP_BLUE ${ORTHANC_STONE_DIR}/Resources/Colormaps/blue.lut 151 COLORMAP_BLUE ${ORTHANC_STONE_DIR}/Resources/Colormaps/blue.lut
159 ) 152 )
160 153
161 154
155
162 ##################################################################### 156 #####################################################################
163 ## System-specific patches 157 ## System-specific patches
164 ##################################################################### 158 #####################################################################
165 159
166 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND 160 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND
174 168
175 ##################################################################### 169 #####################################################################
176 ## All the source files required to build Stone of Orthanc 170 ## All the source files required to build Stone of Orthanc
177 ##################################################################### 171 #####################################################################
178 172
179 set(PLATFORM_SOURCES 173 if (NOT STONE_SANDBOXED)
180 ${ORTHANC_STONE_DIR}/Platforms/Generic/WebServiceGetCommand.cpp 174 set(PLATFORM_SOURCES
181 ${ORTHANC_STONE_DIR}/Platforms/Generic/WebServicePostCommand.cpp 175 ${ORTHANC_STONE_DIR}/Platforms/Generic/WebServiceGetCommand.cpp
182 ${ORTHANC_STONE_DIR}/Platforms/Generic/Oracle.cpp 176 ${ORTHANC_STONE_DIR}/Platforms/Generic/WebServicePostCommand.cpp
183 ) 177 ${ORTHANC_STONE_DIR}/Platforms/Generic/Oracle.cpp
178 )
179
180 set(APPLICATIONS_SOURCES
181 ${ORTHANC_STONE_DIR}/Applications/BasicApplicationContext.cpp
182 ${ORTHANC_STONE_DIR}/Applications/IBasicApplication.cpp
183 ${ORTHANC_STONE_DIR}/Applications/Sdl/SdlEngine.cpp
184 ${ORTHANC_STONE_DIR}/Applications/Sdl/SdlSurface.cpp
185 ${ORTHANC_STONE_DIR}/Applications/Sdl/SdlWindow.cpp
186 )
187 endif()
184 188
185 list(APPEND ORTHANC_STONE_SOURCES 189 list(APPEND ORTHANC_STONE_SOURCES
186 ${ORTHANC_STONE_DIR}/Applications/BasicApplicationContext.cpp
187 ${ORTHANC_STONE_DIR}/Applications/IBasicApplication.cpp
188 ${ORTHANC_STONE_DIR}/Applications/Sdl/SdlEngine.cpp
189 ${ORTHANC_STONE_DIR}/Applications/Sdl/SdlSurface.cpp
190 ${ORTHANC_STONE_DIR}/Applications/Sdl/SdlWindow.cpp
191
192 #${ORTHANC_STONE_DIR}/Framework/Layers/DicomStructureSetRendererFactory.cpp 190 #${ORTHANC_STONE_DIR}/Framework/Layers/DicomStructureSetRendererFactory.cpp
193 #${ORTHANC_STONE_DIR}/Framework/Layers/SeriesFrameRendererFactory.cpp 191 #${ORTHANC_STONE_DIR}/Framework/Layers/SeriesFrameRendererFactory.cpp
194 #${ORTHANC_STONE_DIR}/Framework/Layers/SiblingSliceLocationFactory.cpp 192 #${ORTHANC_STONE_DIR}/Framework/Layers/SiblingSliceLocationFactory.cpp
195 #${ORTHANC_STONE_DIR}/Framework/Layers/SingleFrameRendererFactory.cpp 193 #${ORTHANC_STONE_DIR}/Framework/Layers/SingleFrameRendererFactory.cpp
196 ${ORTHANC_STONE_DIR}/Framework/Layers/CircleMeasureTracker.cpp 194 ${ORTHANC_STONE_DIR}/Framework/Layers/CircleMeasureTracker.cpp
230 ${ORTHANC_STONE_DIR}/Framework/Widgets/TestCairoWidget.cpp 228 ${ORTHANC_STONE_DIR}/Framework/Widgets/TestCairoWidget.cpp
231 ${ORTHANC_STONE_DIR}/Framework/Widgets/TestWorldSceneWidget.cpp 229 ${ORTHANC_STONE_DIR}/Framework/Widgets/TestWorldSceneWidget.cpp
232 ${ORTHANC_STONE_DIR}/Framework/Widgets/WidgetBase.cpp 230 ${ORTHANC_STONE_DIR}/Framework/Widgets/WidgetBase.cpp
233 ${ORTHANC_STONE_DIR}/Framework/Widgets/WorldSceneWidget.cpp 231 ${ORTHANC_STONE_DIR}/Framework/Widgets/WorldSceneWidget.cpp
234 232
233 ${ORTHANC_ROOT}/Plugins/Samples/Common/DicomPath.cpp
234 ${ORTHANC_ROOT}/Plugins/Samples/Common/IOrthancConnection.cpp
235 ${ORTHANC_ROOT}/Plugins/Samples/Common/DicomDatasetReader.cpp
236 ${ORTHANC_ROOT}/Plugins/Samples/Common/FullOrthancDataset.cpp
237
235 ${PLATFORM_SOURCES} 238 ${PLATFORM_SOURCES}
236 239 ${ORTHANC_CORE_SOURCES}
237 ${ORTHANC_ROOT}/Core/ChunkedBuffer.cpp
238 ${ORTHANC_ROOT}/Core/Compression/DeflateBaseCompressor.cpp
239 ${ORTHANC_ROOT}/Core/Compression/GzipCompressor.cpp
240 ${ORTHANC_ROOT}/Core/Enumerations.cpp
241 ${ORTHANC_ROOT}/Core/Images/Image.cpp
242 ${ORTHANC_ROOT}/Core/Images/ImageAccessor.cpp
243 ${ORTHANC_ROOT}/Core/Images/ImageBuffer.cpp
244 ${ORTHANC_ROOT}/Core/Images/ImageProcessing.cpp
245 ${ORTHANC_ROOT}/Core/Images/JpegErrorManager.cpp
246 ${ORTHANC_ROOT}/Core/Images/JpegReader.cpp
247 ${ORTHANC_ROOT}/Core/Images/PngReader.cpp
248 ${ORTHANC_ROOT}/Core/Logging.cpp
249 ${ORTHANC_ROOT}/Core/MultiThreading/SharedMessageQueue.cpp
250 ${ORTHANC_ROOT}/Core/Toolbox.cpp
251 ${ORTHANC_ROOT}/Core/WebServiceParameters.cpp
252 ${ORTHANC_ROOT}/Resources/ThirdParty/base64/base64.cpp
253 ${ORTHANC_ROOT}/Plugins/Samples/Common/DicomDatasetReader.cpp
254 ${ORTHANC_ROOT}/Plugins/Samples/Common/DicomPath.cpp
255 ${ORTHANC_ROOT}/Plugins/Samples/Common/DicomTag.cpp
256 ${ORTHANC_ROOT}/Plugins/Samples/Common/FullOrthancDataset.cpp
257 ${ORTHANC_ROOT}/Plugins/Samples/Common/IOrthancConnection.cpp
258
259 ${AUTOGENERATED_SOURCES} 240 ${AUTOGENERATED_SOURCES}
260 241
261 # Mandatory components 242 # Mandatory components
262 ${BOOST_SOURCES}
263 ${CAIRO_SOURCES} 243 ${CAIRO_SOURCES}
264 ${JSONCPP_SOURCES}
265 ${PIXMAN_SOURCES} 244 ${PIXMAN_SOURCES}
266 ${ZLIB_SOURCES}
267 ${LIBPNG_SOURCES}
268 ${LIBJPEG_SOURCES}
269 245
270 # Optional components 246 # Optional components
271 ${OPENSSL_SOURCES}
272 ${CURL_SOURCES}
273 ${SDL_SOURCES} 247 ${SDL_SOURCES}
274 ) 248 )