Mercurial > hg > orthanc
diff Resources/CMake/DcmtkConfiguration.cmake @ 3839:5bba4d249422 transcoding
integration mainline->transcoding
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 15 Apr 2020 22:03:21 +0200 |
parents | 4a25727401cd a3e38994d95a |
children | d86bddb50972 |
line wrap: on
line diff
--- a/Resources/CMake/DcmtkConfiguration.cmake Fri Apr 10 16:36:02 2020 +0200 +++ b/Resources/CMake/DcmtkConfiguration.cmake Wed Apr 15 22:03:21 2020 +0200 @@ -148,13 +148,34 @@ else() - # The following line allows to manually add libraries at the - # command-line, which is necessary for Ubuntu/Debian packages - set(tmp "${DCMTK_LIBRARIES}") - include(FindDCMTK) - list(APPEND DCMTK_LIBRARIES "${tmp}") + if (CMAKE_CROSSCOMPILING AND + "${CMAKE_SYSTEM_VERSION}" STREQUAL "CrossToolNg") + + CHECK_INCLUDE_FILE_CXX(dcmtk/dcmdata/dcfilefo.h HAVE_DCMTK_H) + if (NOT HAVE_DCMTK_H) + message(FATAL_ERROR "Please install the libdcmtk-dev package") + endif() + + CHECK_LIBRARY_EXISTS(dcmdata "dcmDataDict" "" HAVE_DCMTK_LIB) + if (NOT HAVE_DCMTK_LIB) + message(FATAL_ERROR "Please install the libdcmtk package") + endif() - include_directories(${DCMTK_INCLUDE_DIRS}) + find_path(DCMTK_INCLUDE_DIRS dcmtk/config/osconfig.h + /usr/include + ) + + link_libraries(dcmdata dcmnet dcmjpeg oflog ofstd) + + else() + # The following line allows to manually add libraries at the + # command-line, which is necessary for Ubuntu/Debian packages + set(tmp "${DCMTK_LIBRARIES}") + include(FindDCMTK) + list(APPEND DCMTK_LIBRARIES "${tmp}") + + include_directories(${DCMTK_INCLUDE_DIRS}) + endif() add_definitions( -DHAVE_CONFIG_H=1 @@ -225,6 +246,13 @@ message(FATAL_ERROR "Cannot locate the DICOM dictionary on this system") endif() + if (CMAKE_CROSSCOMPILING AND + "${CMAKE_SYSTEM_VERSION}" STREQUAL "CrossToolNg") + # Remove the sysroot prefix + file(RELATIVE_PATH tmp ${CMAKE_FIND_ROOT_PATH} ${DCMTK_DICTIONARY_DIR_AUTO}) + set(DCMTK_DICTIONARY_DIR_AUTO /${tmp} CACHE INTERNAL "") + endif() + message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}") add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}") else()