comparison Resources/CMake/DcmtkConfigurationStatic-3.6.2.cmake @ 3786:3801435e34a1 SylvainRouquette/fix-issue169-95b752c

integration Orthanc-1.6.0->SylvainRouquette
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 19 Mar 2020 11:48:30 +0100
parents 0654d0838de8
children
comparison
equal deleted inserted replaced
3785:763533d6dd67 3786:3801435e34a1
10 macro(DCMTK_UNSET_CACHE) 10 macro(DCMTK_UNSET_CACHE)
11 endmacro() 11 endmacro()
12 12
13 set(DCMTK_BINARY_DIR ${DCMTK_SOURCES_DIR}/) 13 set(DCMTK_BINARY_DIR ${DCMTK_SOURCES_DIR}/)
14 set(DCMTK_CMAKE_INCLUDE ${DCMTK_SOURCES_DIR}/) 14 set(DCMTK_CMAKE_INCLUDE ${DCMTK_SOURCES_DIR}/)
15 set(DCMTK_WITH_THREADS ON) 15
16 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
17 set(DCMTK_WITH_THREADS OFF) # Disable thread support in wasm/asm.js
18 else()
19 set(DCMTK_WITH_THREADS ON)
20 endif()
16 21
17 add_definitions(-DDCMTK_INSIDE_LOG4CPLUS=1) 22 add_definitions(-DDCMTK_INSIDE_LOG4CPLUS=1)
18 23
19 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}") 24 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}")
20 set(FirstRun OFF) 25 set(FirstRun OFF)
29 # "3.6.2 CXX11 fails on Linux; patch suggestions included" 34 # "3.6.2 CXX11 fails on Linux; patch suggestions included"
30 # https://forum.dcmtk.org/viewtopic.php?f=3&t=4637 35 # https://forum.dcmtk.org/viewtopic.php?f=3&t=4637
31 message("Applying patch to detect mathematic primitives in DCMTK 3.6.2 with C++11") 36 message("Applying patch to detect mathematic primitives in DCMTK 3.6.2 with C++11")
32 execute_process( 37 execute_process(
33 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i 38 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
34 ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.2-cmath.patch 39 ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.2.patch
35 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} 40 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
36 RESULT_VARIABLE Failure 41 RESULT_VARIABLE Failure
37 ) 42 )
38 43
39 if (Failure) 44 if (Failure)
40 message(FATAL_ERROR "Error while patching a file") 45 message(FATAL_ERROR "Error while patching a file")
41 endif() 46 endif()
47
48 configure_file(
49 ${ORTHANC_ROOT}/Resources/Patches/dcmtk-dcdict_orthanc.cc
50 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdict_orthanc.cc
51 COPYONLY)
42 else() 52 else()
43 message("The patches for DCMTK have already been applied") 53 message("The patches for DCMTK have already been applied")
44 endif() 54 endif()
45 55
46 56
70 80
71 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") 81 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
72 SET(DCMTK_ENABLE_CHARSET_CONVERSION "iconv" CACHE STRING "") 82 SET(DCMTK_ENABLE_CHARSET_CONVERSION "iconv" CACHE STRING "")
73 SET(HAVE_SYS_GETTID 0 CACHE INTERNAL "") 83 SET(HAVE_SYS_GETTID 0 CACHE INTERNAL "")
74 84
75 execute_process( 85 if (FirstRun)
76 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i 86 execute_process(
77 ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.2-linux-standard-base.patch 87 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
78 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} 88 ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.2-linux-standard-base.patch
79 RESULT_VARIABLE Failure 89 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
80 ) 90 RESULT_VARIABLE Failure
91 )
81 92
82 if (FirstRun AND Failure) 93 if (Failure)
83 message(FATAL_ERROR "Error while patching a file") 94 message(FATAL_ERROR "Error while patching a file")
95 endif()
84 endif() 96 endif()
85 endif() 97 endif()
98
86 99
87 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR}) 100 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR})
88 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake) 101 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake)
89 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake) 102 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake)
90 103
161 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc 174 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc
162 ) 175 )
163 endif() 176 endif()
164 177
165 178
166 if (ORTHANC_SANDBOXED)
167 configure_file(
168 ${ORTHANC_ROOT}/Resources/WebAssembly/dcdict.h
169 ${DCMTK_SOURCES_DIR}/dcmdata/include/dcmtk/dcmdata/dcdict.h
170 COPYONLY)
171
172 configure_file(
173 ${ORTHANC_ROOT}/Resources/WebAssembly/dcdict.cc
174 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdict.cc
175 COPYONLY)
176 endif()
177
178
179 #set_source_files_properties(${DCMTK_SOURCES} 179 #set_source_files_properties(${DCMTK_SOURCES}
180 # PROPERTIES COMPILE_DEFINITIONS 180 # PROPERTIES COMPILE_DEFINITIONS
181 # "PACKAGE_VERSION=\"${DCMTK_PACKAGE_VERSION}\";PACKAGE_VERSION_NUMBER=\"${DCMTK_VERSION_NUMBER}\"") 181 # "PACKAGE_VERSION=\"${DCMTK_PACKAGE_VERSION}\";PACKAGE_VERSION_NUMBER=\"${DCMTK_VERSION_NUMBER}\"")
182 182
183 183