0
|
1 if (${STATIC_BUILD})
|
|
2 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0)
|
|
3 DownloadPackage("ftp://dicom.offis.de/pub/dicom/offis/software/dcmtk/dcmtk360/dcmtk-3.6.0.zip" "${DCMTK_SOURCES_DIR}" "" "")
|
|
4
|
|
5 IF(CMAKE_CROSSCOMPILING)
|
|
6 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.")
|
|
7 ENDIF()
|
|
8 SET(DCMTK_SOURCE_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0)
|
|
9 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake)
|
|
10 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake)
|
|
11 CONFIGURE_FILE(${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in
|
|
12 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h)
|
|
13
|
|
14 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmnet/libsrc THIRD_PARTY_SOURCES)
|
|
15 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc THIRD_PARTY_SOURCES)
|
|
16 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc THIRD_PARTY_SOURCES)
|
|
17 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc THIRD_PARTY_SOURCES)
|
|
18
|
|
19 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
20 list(REMOVE_ITEM THIRD_PARTY_SOURCES
|
|
21 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc
|
|
22 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc
|
|
23 )
|
|
24 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
|
25 list(REMOVE_ITEM THIRD_PARTY_SOURCES
|
|
26 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc
|
|
27 )
|
|
28 endif()
|
|
29
|
|
30 list(REMOVE_ITEM THIRD_PARTY_SOURCES
|
|
31 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc
|
|
32 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc
|
|
33 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdictbi.cc
|
|
34 )
|
|
35
|
|
36 # This fixes crashes related to the destruction of the DCMTK OFLogger
|
|
37 # http://support.dcmtk.org/docs-snapshot/file_macros.html
|
|
38 add_definitions(-DLOG4CPLUS_DISABLE_FATAL=1)
|
|
39
|
|
40 include_directories(
|
|
41 #${DCMTK_SOURCES_DIR}
|
|
42 ${DCMTK_SOURCES_DIR}/config/include
|
|
43 ${DCMTK_SOURCES_DIR}/dcmnet/include
|
|
44 ${DCMTK_SOURCES_DIR}/ofstd/include
|
|
45 ${DCMTK_SOURCES_DIR}/oflog/include
|
|
46 ${DCMTK_SOURCES_DIR}/dcmdata/include
|
|
47 )
|
|
48
|
|
49 else()
|
|
50 include(FindDCMTK)
|
|
51
|
|
52 include_directories(${DCMTK_INCLUDE_DIR})
|
|
53 link_libraries(${DCMTK_LIBRARIES} oflog ofstd wrap)
|
|
54
|
|
55 add_definitions(
|
|
56 -DHAVE_CONFIG_H=1
|
|
57 )
|
|
58 endif()
|