comparison Resources/CMake/DcmtkConfiguration.cmake @ 1785:c131566b8252 dcmtk-3.6.1

integration mainline->dcmtk-3.6.1
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Nov 2015 10:16:21 +0100
parents 1b82bb0446d2 6473e4e22d44
children 4f2386d0f326
comparison
equal deleted inserted replaced
1639:1b82bb0446d2 1785:c131566b8252
1 # Lookup for DICOM dictionaries, if none is specified by the user
2 if (DCMTK_DICTIONARY_DIR STREQUAL "")
3 find_path(DCMTK_DICTIONARY_DIR_AUTO dicom.dic
4 /usr/share/dcmtk
5 /usr/share/libdcmtk2
6 /usr/local/share/dcmtk
7 )
8
9 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}")
10 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}")
11 else()
12 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}")
13 endif()
14
15
16 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK) 1 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK)
17 SET(DCMTK_VERSION_NUMBER 361) 2 SET(DCMTK_VERSION_NUMBER 361)
18 set(DCMTK_PACKAGE_VERSION "3.6.1") 3 set(DCMTK_PACKAGE_VERSION "3.6.1")
19 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.1_20150629) 4 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.1_20150629)
20 SET(DCMTK_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.1_20150629.tar.gz") 5 SET(DCMTK_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.1_20150629.tar.gz")
164 source_group(ThirdParty\\Dcmtk REGULAR_EXPRESSION ${DCMTK_SOURCES_DIR}/.*) 149 source_group(ThirdParty\\Dcmtk REGULAR_EXPRESSION ${DCMTK_SOURCES_DIR}/.*)
165 150
166 set(DCMTK_BUNDLES_LOG4CPLUS 1) 151 set(DCMTK_BUNDLES_LOG4CPLUS 1)
167 152
168 if (STANDALONE_BUILD) 153 if (STANDALONE_BUILD)
169 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=1) 154 set(DCMTK_USE_EMBEDDED_DICTIONARIES 1)
170 else() 155 set(DCMTK_DICTIONARIES
171 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=0) 156 DICTIONARY_DICOM ${DCMTK_SOURCES_DIR}/dcmdata/data/dicom.dic
172 endif() 157 DICTIONARY_PRIVATE ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic
173 158 DICTIONARY_DICONDE ${DCMTK_SOURCES_DIR}/dcmdata/data/diconde.dic
174 set(DCMTK_DICTIONARIES 159 )
175 DICTIONARY_DICOM ${DCMTK_SOURCES_DIR}/dcmdata/data/dicom.dic 160 else()
176 DICTIONARY_PRIVATE ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic 161 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0)
177 DICTIONARY_DICONDE ${DCMTK_SOURCES_DIR}/dcmdata/data/diconde.dic 162 endif()
178 )
179 163
180 else() 164 else()
181 # The following line allows to manually add libraries at the 165 # The following line allows to manually add libraries at the
182 # command-line, which is necessary for Ubuntu/Debian packages 166 # command-line, which is necessary for Ubuntu/Debian packages
183 set(tmp "${DCMTK_LIBRARIES}") 167 set(tmp "${DCMTK_LIBRARIES}")
208 ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$" 192 ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$"
209 "\\1\\2\\3" 193 "\\1\\2\\3"
210 DCMTK_VERSION_NUMBER 194 DCMTK_VERSION_NUMBER
211 ${DCMTK_VERSION_NUMBER1}) 195 ${DCMTK_VERSION_NUMBER1})
212 196
213 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=0) 197 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0)
214
215 endif() 198 endif()
199
216 200
217 add_definitions(-DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER}) 201 add_definitions(-DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER})
218 message("DCMTK version: ${DCMTK_VERSION_NUMBER}") 202 message("DCMTK version: ${DCMTK_VERSION_NUMBER}")
203
204
205 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=${DCMTK_USE_EMBEDDED_DICTIONARIES})
206 if (NOT DCMTK_USE_EMBEDDED_DICTIONARIES)
207 # Lookup for DICOM dictionaries, if none is specified by the user
208 if (DCMTK_DICTIONARY_DIR STREQUAL "")
209 find_path(DCMTK_DICTIONARY_DIR_AUTO dicom.dic
210 /usr/share/dcmtk
211 /usr/share/libdcmtk2
212 /usr/share/libdcmtk4
213 /usr/local/share/dcmtk
214 )
215
216 if (${DCMTK_DICTIONARY_DIR_AUTO} MATCHES "DCMTK_DICTIONARY_DIR_AUTO-NOTFOUND")
217 message(FATAL_ERROR "Cannot locate the DICOM dictionary on this system")
218 endif()
219
220 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}")
221 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}")
222 else()
223 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}")
224 endif()
225 endif()