comparison Resources/CMake/DcmtkConfiguration.cmake @ 3833:a3e38994d95a

compilation on mips qemu
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 15 Apr 2020 14:45:52 +0200
parents d737173197e1
children 5bba4d249422
comparison
equal deleted inserted replaced
3832:ab9a0d1e0cc1 3833:a3e38994d95a
131 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0) 131 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0)
132 endif() 132 endif()
133 133
134 134
135 else() 135 else()
136 # The following line allows to manually add libraries at the 136 if (CMAKE_CROSSCOMPILING AND
137 # command-line, which is necessary for Ubuntu/Debian packages 137 "${CMAKE_SYSTEM_VERSION}" STREQUAL "CrossToolNg")
138 set(tmp "${DCMTK_LIBRARIES}") 138
139 include(FindDCMTK) 139 CHECK_INCLUDE_FILE_CXX(dcmtk/dcmdata/dcfilefo.h HAVE_DCMTK_H)
140 list(APPEND DCMTK_LIBRARIES "${tmp}") 140 if (NOT HAVE_DCMTK_H)
141 141 message(FATAL_ERROR "Please install the libdcmtk-dev package")
142 include_directories(${DCMTK_INCLUDE_DIRS}) 142 endif()
143
144 CHECK_LIBRARY_EXISTS(dcmdata "dcmDataDict" "" HAVE_DCMTK_LIB)
145 if (NOT HAVE_DCMTK_LIB)
146 message(FATAL_ERROR "Please install the libdcmtk package")
147 endif()
148
149 find_path(DCMTK_INCLUDE_DIRS dcmtk/config/osconfig.h
150 /usr/include
151 )
152
153 link_libraries(dcmdata dcmnet dcmjpeg oflog ofstd)
154
155 else()
156 # The following line allows to manually add libraries at the
157 # command-line, which is necessary for Ubuntu/Debian packages
158 set(tmp "${DCMTK_LIBRARIES}")
159 include(FindDCMTK)
160 list(APPEND DCMTK_LIBRARIES "${tmp}")
161
162 include_directories(${DCMTK_INCLUDE_DIRS})
163 endif()
143 164
144 add_definitions( 165 add_definitions(
145 -DHAVE_CONFIG_H=1 166 -DHAVE_CONFIG_H=1
146 ) 167 )
147 168
208 229
209 if (${DCMTK_DICTIONARY_DIR_AUTO} MATCHES "DCMTK_DICTIONARY_DIR_AUTO-NOTFOUND") 230 if (${DCMTK_DICTIONARY_DIR_AUTO} MATCHES "DCMTK_DICTIONARY_DIR_AUTO-NOTFOUND")
210 message(FATAL_ERROR "Cannot locate the DICOM dictionary on this system") 231 message(FATAL_ERROR "Cannot locate the DICOM dictionary on this system")
211 endif() 232 endif()
212 233
234 if (CMAKE_CROSSCOMPILING AND
235 "${CMAKE_SYSTEM_VERSION}" STREQUAL "CrossToolNg")
236 # Remove the sysroot prefix
237 file(RELATIVE_PATH tmp ${CMAKE_FIND_ROOT_PATH} ${DCMTK_DICTIONARY_DIR_AUTO})
238 set(DCMTK_DICTIONARY_DIR_AUTO /${tmp} CACHE INTERNAL "")
239 endif()
240
213 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}") 241 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}")
214 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}") 242 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}")
215 else() 243 else()
216 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}") 244 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}")
217 endif() 245 endif()