comparison Resources/CMake/DcmtkConfiguration.cmake @ 1951:01de36d949c3

Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 05 Apr 2016 14:45:55 +0200
parents bc949ea71fe6
children e92280e63d8d
comparison
equal deleted inserted replaced
1950:533ff46e944b 1951:01de36d949c3
1 if (NOT DEFINED ENABLE_DCMTK_NETWORKING) 1 if (NOT DEFINED ENABLE_DCMTK_NETWORKING)
2 set(ENABLE_DCMTK_NETWORKING ON) 2 set(ENABLE_DCMTK_NETWORKING ON)
3 endif() 3 endif()
4 4
5 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK) 5 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK)
6 SET(DCMTK_VERSION_NUMBER 360) 6 if (USE_DCMTK_361)
7 SET(DCMTK_PACKAGE_VERSION "3.6.0") 7 SET(DCMTK_VERSION_NUMBER 361)
8 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0) 8 SET(DCMTK_PACKAGE_VERSION "3.6.1")
9 SET(DCMTK_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.0.zip") 9 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.1_20160216)
10 SET(DCMTK_MD5 "219ad631b82031806147e4abbfba4fa4") 10 SET(DCMTK_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.1_20160216.tar.gz")
11 SET(DCMTK_MD5 "273c8a544b9fe09b8a4fb4eb51df8e52")
12 SET(DCMTK_PATCH_SPEED "${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.1-speed.patch")
13
14 macro(DCMTK_UNSET)
15 endmacro()
16
17 set(DCMTK_BINARY_DIR ${DCMTK_SOURCES_DIR}/)
18 set(DCMTK_CMAKE_INCLUDE ${DCMTK_SOURCES_DIR}/)
19 add_definitions(-DDCMTK_INSIDE_LOG4CPLUS=1)
20 else()
21 SET(DCMTK_VERSION_NUMBER 360)
22 SET(DCMTK_PACKAGE_VERSION "3.6.0")
23 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0)
24 SET(DCMTK_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.0.zip")
25 SET(DCMTK_MD5 "219ad631b82031806147e4abbfba4fa4")
26 SET(DCMTK_PATCH_SPEED "${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.0-speed.patch")
27 SET(DCMTK_PATCH_MINGW64 "${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.0-mingw64.patch")
28 endif()
11 29
12 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}") 30 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}")
13 set(FirstRun OFF) 31 set(FirstRun OFF)
14 else() 32 else()
15 set(FirstRun ON) 33 set(FirstRun ON)
42 60
43 CONFIGURE_FILE( 61 CONFIGURE_FILE(
44 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in 62 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in
45 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h) 63 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h)
46 64
65 if (USE_DCMTK_361)
66 # This step must be after the generation of "osconfig.h"
67 INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES()
68 endif()
69
47 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES) 70 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES)
48 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES) 71 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES)
49 72
50 if (ENABLE_DCMTK_NETWORKING) 73 if (ENABLE_DCMTK_NETWORKING)
51 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmnet/libsrc DCMTK_SOURCES) 74 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmnet/libsrc DCMTK_SOURCES)
107 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR 130 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
108 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR 131 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR
109 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR 132 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
110 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") 133 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD")
111 list(REMOVE_ITEM DCMTK_SOURCES 134 list(REMOVE_ITEM DCMTK_SOURCES
135 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc
112 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc 136 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc
113 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc 137 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc
114 ) 138 )
115 139
116 execute_process( 140 execute_process(
117 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${ORTHANC_ROOT}/Resources/Patches/dcmtk-linux-speed.patch 141 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${DCMTK_PATCH_SPEED}
118 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} 142 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
119 RESULT_VARIABLE Failure 143 RESULT_VARIABLE Failure
120 ) 144 )
121 145
122 if (Failure AND FirstRun) 146 if (Failure AND FirstRun)
126 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") 150 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
127 list(REMOVE_ITEM DCMTK_SOURCES 151 list(REMOVE_ITEM DCMTK_SOURCES
128 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc 152 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc
129 ) 153 )
130 154
131 if (CMAKE_COMPILER_IS_GNUCXX) 155 if (CMAKE_COMPILER_IS_GNUCXX AND DCMTK_PATCH_MINGW64)
132 # This is a patch for MinGW64 156 # This is a patch for MinGW64
133 execute_process( 157 execute_process(
134 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${ORTHANC_ROOT}/Resources/Patches/dcmtk-mingw64.patch 158 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${DCMTK_PATCH_MINGW64}
135 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} 159 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
136 RESULT_VARIABLE Failure 160 RESULT_VARIABLE Failure
137 ) 161 )
138 162
139 if (Failure AND FirstRun) 163 if (Failure AND FirstRun)
142 endif() 166 endif()
143 167
144 # This patch improves speed, even for Windows 168 # This patch improves speed, even for Windows
145 execute_process( 169 execute_process(
146 COMMAND ${PATCH_EXECUTABLE} -p0 -N 170 COMMAND ${PATCH_EXECUTABLE} -p0 -N
147 INPUT_FILE ${ORTHANC_ROOT}/Resources/Patches/dcmtk-linux-speed.patch 171 INPUT_FILE ${DCMTK_PATCH_SPEED}
148 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} 172 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
149 RESULT_VARIABLE Failure 173 RESULT_VARIABLE Failure
150 ) 174 )
151 175
152 if (Failure AND FirstRun) 176 if (Failure AND FirstRun)
155 endif() 179 endif()
156 180
157 list(REMOVE_ITEM DCMTK_SOURCES 181 list(REMOVE_ITEM DCMTK_SOURCES
158 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc 182 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc
159 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc 183 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc
160 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdictbi.cc 184 #${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdictbi.cc
161 ) 185 )
162 186
163 #set_source_files_properties(${DCMTK_SOURCES} 187 #set_source_files_properties(${DCMTK_SOURCES}
164 # PROPERTIES COMPILE_DEFINITIONS 188 # PROPERTIES COMPILE_DEFINITIONS
165 # "PACKAGE_VERSION=\"${DCMTK_PACKAGE_VERSION}\";PACKAGE_VERSION_NUMBER=\"${DCMTK_VERSION_NUMBER}\"") 189 # "PACKAGE_VERSION=\"${DCMTK_PACKAGE_VERSION}\";PACKAGE_VERSION_NUMBER=\"${DCMTK_VERSION_NUMBER}\"")