Mercurial > hg > orthanc
comparison Resources/CMake/DcmtkConfiguration.cmake @ 1633:b7dfb048b2f3 dcmtk-3.6.1
setup
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 23 Sep 2015 09:55:23 +0200 |
parents | 17a3814fd8a1 |
children | 0844a4bcb0ad |
comparison
equal
deleted
inserted
replaced
1632:eb8fbcf008b5 | 1633:b7dfb048b2f3 |
---|---|
12 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}") | 12 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}") |
13 endif() | 13 endif() |
14 | 14 |
15 | 15 |
16 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK) | 16 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK) |
17 SET(DCMTK_VERSION_NUMBER 360) | 17 SET(DCMTK_VERSION_NUMBER 361) |
18 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0) | 18 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.1_20150629) |
19 SET(DCMTK_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.0.zip") | 19 SET(DCMTK_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.1_20150629.tar.gz") |
20 SET(DCMTK_MD5 "219ad631b82031806147e4abbfba4fa4") | 20 SET(DCMTK_MD5 "2faf73786fc638ae05fef0103cce0eea") |
21 | 21 |
22 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}") | 22 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}") |
23 set(FirstRun OFF) | 23 set(FirstRun OFF) |
24 else() | 24 else() |
25 set(FirstRun ON) | 25 set(FirstRun ON) |
26 endif() | 26 endif() |
27 | 27 |
28 # Definitions for DCMTK 3.6.1 | |
29 macro(DCMTK_UNSET) | |
30 endmacro() | |
31 | |
32 set(DCMTK_CMAKE_INCLUDE ${DCMTK_SOURCES_DIR}/) | |
33 # End | |
34 | |
35 | |
28 DownloadPackage(${DCMTK_MD5} ${DCMTK_URL} "${DCMTK_SOURCES_DIR}") | 36 DownloadPackage(${DCMTK_MD5} ${DCMTK_URL} "${DCMTK_SOURCES_DIR}") |
29 | 37 |
30 IF (CMAKE_CROSSCOMPILING) | 38 IF (CMAKE_CROSSCOMPILING) |
31 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.") | 39 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.") |
32 ENDIF() | 40 ENDIF() |
33 SET(DCMTK_SOURCE_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0) | 41 SET(DCMTK_SOURCE_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.1) |
34 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake) | 42 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake) |
35 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake) | 43 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake) |
36 | 44 |
37 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | 45 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
38 set(HAVE_SSTREAM 1) | 46 set(HAVE_SSTREAM 1) |
45 set(HAVE_PROTOTYPE_ACCEPT 1) | 53 set(HAVE_PROTOTYPE_ACCEPT 1) |
46 set(HAVE_PROTOTYPE_SETSOCKNAME 1) | 54 set(HAVE_PROTOTYPE_SETSOCKNAME 1) |
47 set(HAVE_PROTOTYPE_GETSOCKNAME 1) | 55 set(HAVE_PROTOTYPE_GETSOCKNAME 1) |
48 endif() | 56 endif() |
49 | 57 |
50 set(DCMTK_PACKAGE_VERSION "3.6.0") | 58 set(DCMTK_PACKAGE_VERSION "3.6.1") |
51 set(DCMTK_PACKAGE_VERSION_SUFFIX "") | 59 set(DCMTK_PACKAGE_VERSION_SUFFIX "") |
52 set(DCMTK_PACKAGE_VERSION_NUMBER 360) | 60 set(DCMTK_PACKAGE_VERSION_NUMBER 360) |
53 | 61 |
54 CONFIGURE_FILE( | 62 CONFIGURE_FILE( |
55 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in | 63 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in |
104 list(REMOVE_ITEM DCMTK_SOURCES | 112 list(REMOVE_ITEM DCMTK_SOURCES |
105 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc | 113 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc |
106 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc | 114 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc |
107 ) | 115 ) |
108 | 116 |
109 execute_process( | |
110 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${ORTHANC_ROOT}/Resources/Patches/dcmtk-linux-speed.patch | |
111 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | |
112 RESULT_VARIABLE Failure | |
113 ) | |
114 | |
115 if (Failure AND FirstRun) | |
116 message(FATAL_ERROR "Error while patching a file") | |
117 endif() | |
118 | |
119 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | 117 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
120 list(REMOVE_ITEM DCMTK_SOURCES | 118 list(REMOVE_ITEM DCMTK_SOURCES |
121 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc | 119 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc |
122 ) | 120 ) |
123 | |
124 if (CMAKE_COMPILER_IS_GNUCXX) | |
125 # This is a patch for MinGW64 | |
126 execute_process( | |
127 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${ORTHANC_ROOT}/Resources/Patches/dcmtk-mingw64.patch | |
128 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | |
129 RESULT_VARIABLE Failure | |
130 ) | |
131 | |
132 if (Failure AND FirstRun) | |
133 message(FATAL_ERROR "Error while patching a file") | |
134 endif() | |
135 endif() | |
136 | |
137 # This patch improves speed, even for Windows | |
138 execute_process( | |
139 COMMAND ${PATCH_EXECUTABLE} -p0 -N | |
140 INPUT_FILE ${ORTHANC_ROOT}/Resources/Patches/dcmtk-linux-speed.patch | |
141 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | |
142 RESULT_VARIABLE Failure | |
143 ) | |
144 | |
145 if (Failure AND FirstRun) | |
146 message(FATAL_ERROR "Error while patching a file") | |
147 endif() | |
148 endif() | 121 endif() |
149 | 122 |
150 list(REMOVE_ITEM DCMTK_SOURCES | 123 list(REMOVE_ITEM DCMTK_SOURCES |
151 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc | 124 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc |
152 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc | 125 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc |
153 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdictbi.cc | 126 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdictbi.cc |
154 ) | 127 ) |
155 | 128 |
156 #set_source_files_properties(${DCMTK_SOURCES} | 129 #set_source_files_properties(${DCMTK_SOURCES} |
157 # PROPERTIES COMPILE_DEFINITIONS | 130 # PROPERTIES COMPILE_DEFINITIONS |
158 # "PACKAGE_VERSION=\"3.6.0\";PACKAGE_VERSION_NUMBER=\"360\"") | 131 # "PACKAGE_VERSION=\"3.6.1\";PACKAGE_VERSION_NUMBER=\"360\"") |
159 | 132 |
160 # This fixes crashes related to the destruction of the DCMTK OFLogger | 133 # This fixes crashes related to the destruction of the DCMTK OFLogger |
161 # http://support.dcmtk.org/docs-snapshot/file_macros.html | 134 # http://support.dcmtk.org/docs-snapshot/file_macros.html |
162 add_definitions( | 135 add_definitions( |
163 -DLOG4CPLUS_DISABLE_FATAL=1 | 136 -DLOG4CPLUS_DISABLE_FATAL=1 |