comparison Resources/CMake/DcmtkConfiguration.cmake @ 2513:97a74f0eac7a

loading DICOM dictionaries in sandboxed environments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 28 Mar 2018 18:02:07 +0200
parents 4dcafa8d6633
children 7c8a246e8652
comparison
equal deleted inserted replaced
2512:4dcafa8d6633 2513:97a74f0eac7a
105 CMAKE_SYSTEM_NAME STREQUAL "Windows") # MinGW 105 CMAKE_SYSTEM_NAME STREQUAL "Windows") # MinGW
106 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.") 106 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.")
107 107
108 elseif(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # WebAssembly or asm.js 108 elseif(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # WebAssembly or asm.js
109 # Check out "../WebAssembly/arith.h" 109 # Check out "../WebAssembly/arith.h"
110 UNSET(SIZEOF_VOID_P CACHE)
111 UNSET(SIZEOF_CHAR CACHE)
112 UNSET(SIZEOF_DOUBLE CACHE)
113 UNSET(SIZEOF_FLOAT CACHE)
114 UNSET(SIZEOF_INT CACHE)
115 UNSET(SIZEOF_LONG CACHE)
116 UNSET(SIZEOF_SHORT CACHE)
117 UNSET(SIZEOF_VOID_P CACHE)
118 UNSET(C_CHAR_UNSIGNED CACHE)
119
110 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "") 120 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "")
111 SET(SIZEOF_CHAR 1 CACHE INTERNAL "") 121 SET(SIZEOF_CHAR 1 CACHE INTERNAL "")
112 SET(SIZEOF_DOUBLE 8 CACHE INTERNAL "") 122 SET(SIZEOF_DOUBLE 8 CACHE INTERNAL "")
113 SET(SIZEOF_FLOAT 4 CACHE INTERNAL "") 123 SET(SIZEOF_FLOAT 4 CACHE INTERNAL "")
114 SET(SIZEOF_INT 4 CACHE INTERNAL "") 124 SET(SIZEOF_INT 4 CACHE INTERNAL "")
115 SET(SIZEOF_LONG 4 CACHE INTERNAL "") 125 SET(SIZEOF_LONG 4 CACHE INTERNAL "")
116 SET(SIZEOF_SHORT 2 CACHE INTERNAL "") 126 SET(SIZEOF_SHORT 2 CACHE INTERNAL "")
117 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "") 127 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "")
118 SET(C_CHAR_UNSIGNED 0 CACHE INTERNAL "") 128 SET(C_CHAR_UNSIGNED 0 CACHE INTERNAL "")
129
119 configure_file( 130 configure_file(
120 ${ORTHANC_ROOT}/Resources/WebAssembly/arith.h 131 ${ORTHANC_ROOT}/Resources/WebAssembly/arith.h
121 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/arith.h 132 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/arith.h
122 COPYONLY) 133 COPYONLY)
123 134
124 else() 135 else()
125 message(FATAL_ERROR "Support your platform here") 136 message(FATAL_ERROR "Support your platform here")
126 endif() 137 endif()
127 ENDIF() 138 ENDIF()
139
128 140
129 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") 141 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
130 SET(DCMTK_ENABLE_CHARSET_CONVERSION "iconv" CACHE STRING "") 142 SET(DCMTK_ENABLE_CHARSET_CONVERSION "iconv" CACHE STRING "")
131 SET(HAVE_SYS_GETTID 0 CACHE INTERNAL "") 143 SET(HAVE_SYS_GETTID 0 CACHE INTERNAL "")
132 144
266 message(FATAL_ERROR "Error while patching a file") 278 message(FATAL_ERROR "Error while patching a file")
267 endif() 279 endif()
268 endif() 280 endif()
269 endif() 281 endif()
270 282
283
284 if (USE_DCMTK_360)
285 # Removing this file is required with DCMTK 3.6.0
286 list(REMOVE_ITEM DCMTK_SOURCES
287
288 )
289 else()
290 if (ORTHANC_SANDBOXED)
291 configure_file(
292 ${ORTHANC_ROOT}/Resources/WebAssembly/dcdict.h
293 ${DCMTK_SOURCES_DIR}/dcmdata/include/dcmtk/dcmdata/dcdict.h
294 COPYONLY)
295
296 configure_file(
297 ${ORTHANC_ROOT}/Resources/WebAssembly/dcdict.cc
298 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdict.cc
299 COPYONLY)
300 endif()
301 endif()
302
303
271 list(REMOVE_ITEM DCMTK_SOURCES 304 list(REMOVE_ITEM DCMTK_SOURCES
272 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc 305 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc
273 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc 306 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc
274 ) 307 )
275
276 if (USE_DCMTK_360)
277 # Removing this file is required with DCMTK 3.6.0
278 list(REMOVE_ITEM DCMTK_SOURCES
279 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdictbi.cc
280 )
281 endif()
282 308
283 #set_source_files_properties(${DCMTK_SOURCES} 309 #set_source_files_properties(${DCMTK_SOURCES}
284 # PROPERTIES COMPILE_DEFINITIONS 310 # PROPERTIES COMPILE_DEFINITIONS
285 # "PACKAGE_VERSION=\"${DCMTK_PACKAGE_VERSION}\";PACKAGE_VERSION_NUMBER=\"${DCMTK_VERSION_NUMBER}\"") 311 # "PACKAGE_VERSION=\"${DCMTK_PACKAGE_VERSION}\";PACKAGE_VERSION_NUMBER=\"${DCMTK_VERSION_NUMBER}\"")
286 312