comparison Resources/CMake/DcmtkConfiguration.cmake @ 1770:6473e4e22d44

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 10 Nov 2015 16:59:17 +0100
parents cb466194f22c
children c131566b8252 3dcf5c0734c9
comparison
equal deleted inserted replaced
1769:cb466194f22c 1770:6473e4e22d44
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/share/libdcmtk4
7 /usr/local/share/dcmtk
8 )
9
10 if (${DCMTK_DICTIONARY_DIR_AUTO} MATCHES "DCMTK_DICTIONARY_DIR_AUTO-NOTFOUND")
11 message(FATAL_ERROR "Cannot locate the DICOM dictionary on this system")
12 endif()
13
14 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}")
15 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}")
16 else()
17 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}")
18 endif()
19
20
21 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK) 1 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK)
22 SET(DCMTK_VERSION_NUMBER 360) 2 SET(DCMTK_VERSION_NUMBER 360)
23 set(DCMTK_PACKAGE_VERSION "3.6.0") 3 set(DCMTK_PACKAGE_VERSION "3.6.0")
24 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0) 4 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0)
25 SET(DCMTK_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.0.zip") 5 SET(DCMTK_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.0.zip")
181 source_group(ThirdParty\\Dcmtk REGULAR_EXPRESSION ${DCMTK_SOURCES_DIR}/.*) 161 source_group(ThirdParty\\Dcmtk REGULAR_EXPRESSION ${DCMTK_SOURCES_DIR}/.*)
182 162
183 set(DCMTK_BUNDLES_LOG4CPLUS 1) 163 set(DCMTK_BUNDLES_LOG4CPLUS 1)
184 164
185 if (STANDALONE_BUILD) 165 if (STANDALONE_BUILD)
186 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=1) 166 set(DCMTK_USE_EMBEDDED_DICTIONARIES 1)
187 else() 167 set(DCMTK_DICTIONARIES
188 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=0) 168 DICTIONARY_DICOM ${DCMTK_SOURCES_DIR}/dcmdata/data/dicom.dic
189 endif() 169 DICTIONARY_PRIVATE ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic
190 170 DICTIONARY_DICONDE ${DCMTK_SOURCES_DIR}/dcmdata/data/diconde.dic
191 set(DCMTK_DICTIONARIES 171 )
192 DICTIONARY_DICOM ${DCMTK_SOURCES_DIR}/dcmdata/data/dicom.dic 172 else()
193 DICTIONARY_PRIVATE ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic 173 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0)
194 DICTIONARY_DICONDE ${DCMTK_SOURCES_DIR}/dcmdata/data/diconde.dic 174 endif()
195 )
196 175
197 else() 176 else()
198 # The following line allows to manually add libraries at the 177 # The following line allows to manually add libraries at the
199 # command-line, which is necessary for Ubuntu/Debian packages 178 # command-line, which is necessary for Ubuntu/Debian packages
200 set(tmp "${DCMTK_LIBRARIES}") 179 set(tmp "${DCMTK_LIBRARIES}")
225 ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$" 204 ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$"
226 "\\1\\2\\3" 205 "\\1\\2\\3"
227 DCMTK_VERSION_NUMBER 206 DCMTK_VERSION_NUMBER
228 ${DCMTK_VERSION_NUMBER1}) 207 ${DCMTK_VERSION_NUMBER1})
229 208
230 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=0) 209 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0)
231
232 endif() 210 endif()
211
233 212
234 add_definitions(-DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER}) 213 add_definitions(-DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER})
235 message("DCMTK version: ${DCMTK_VERSION_NUMBER}") 214 message("DCMTK version: ${DCMTK_VERSION_NUMBER}")
215
216
217 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=${DCMTK_USE_EMBEDDED_DICTIONARIES})
218 if (NOT DCMTK_USE_EMBEDDED_DICTIONARIES)
219 # Lookup for DICOM dictionaries, if none is specified by the user
220 if (DCMTK_DICTIONARY_DIR STREQUAL "")
221 find_path(DCMTK_DICTIONARY_DIR_AUTO dicom.dic
222 /usr/share/dcmtk
223 /usr/share/libdcmtk2
224 /usr/share/libdcmtk4
225 /usr/local/share/dcmtk
226 )
227
228 if (${DCMTK_DICTIONARY_DIR_AUTO} MATCHES "DCMTK_DICTIONARY_DIR_AUTO-NOTFOUND")
229 message(FATAL_ERROR "Cannot locate the DICOM dictionary on this system")
230 endif()
231
232 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}")
233 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}")
234 else()
235 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}")
236 endif()
237 endif()