annotate Resources/CMake/DcmtkConfiguration.cmake @ 841:89a593f66104 jpeg

fix windows build
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Jun 2014 20:37:35 +0200
parents dfb13218f8ca
children 502c49adb5ad
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
735
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
1 # Lookup for DICOM dictionaries, if none is specified by the user
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
2 if (DCMTK_DICTIONARY_DIR STREQUAL "")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
3 find_path(DCMTK_DICTIONARY_DIR_AUTO dicom.dic
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
4 /usr/share/dcmtk
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
5 /usr/share/libdcmtk2
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
6 )
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
7
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
8 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
9 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
10 else()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
11 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
12 endif()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
13
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
14
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
15
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
16 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
17 SET(DCMTK_VERSION_NUMBER 360)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
18 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
19 DownloadPackage(
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
20 "219ad631b82031806147e4abbfba4fa4"
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
21 "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.0.zip"
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
22 "${DCMTK_SOURCES_DIR}")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
23
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
24 IF(CMAKE_CROSSCOMPILING)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
25 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
26 ENDIF()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
27 SET(DCMTK_SOURCE_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
28 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
29 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
30
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
31 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
32 set(HAVE_SSTREAM 1)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
33 set(HAVE_PROTOTYPE_BZERO 1)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
34 set(HAVE_PROTOTYPE_GETHOSTNAME 1)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
35 set(HAVE_PROTOTYPE_GETSOCKOPT 1)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
36 set(HAVE_PROTOTYPE_SETSOCKOPT 1)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
37 set(HAVE_PROTOTYPE_CONNECT 1)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
38 set(HAVE_PROTOTYPE_BIND 1)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
39 set(HAVE_PROTOTYPE_ACCEPT 1)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
40 set(HAVE_PROTOTYPE_SETSOCKNAME 1)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
41 set(HAVE_PROTOTYPE_GETSOCKNAME 1)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
42 endif()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
43
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
44 CONFIGURE_FILE(
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
45 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
46 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
47
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
48 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmnet/libsrc DCMTK_SOURCES)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
49 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
50 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
51
839
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
52 if (ENABLE_JPEG_LOSSLESS)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
53 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libsrc DCMTK_SOURCES)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
54 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libcharls DCMTK_SOURCES)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
55 include_directories(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
56 ${DCMTK_SOURCES_DIR}/dcmjpls/include
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
57 ${DCMTK_SOURCES_DIR}/dcmjpls/libcharls
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
58 )
841
89a593f66104 fix windows build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 839
diff changeset
59 list(REMOVE_ITEM DCMTK_SOURCES
89a593f66104 fix windows build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 839
diff changeset
60 ${DCMTK_SOURCES_DIR}/dcmjpls/libsrc/djcodece.cc)
839
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
61 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
62
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
63
735
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
64 # Source for the logging facility of DCMTK
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
65 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
66 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
67 list(REMOVE_ITEM DCMTK_SOURCES
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
68 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
69 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
70 )
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
71 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
72 list(REMOVE_ITEM DCMTK_SOURCES
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
73 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
74 )
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
75
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
76 if (${CMAKE_COMPILER_IS_GNUCXX})
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
77 # This is a patch for MinGW64
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
78 execute_process(
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
79 COMMAND patch -p0 -i ${CMAKE_SOURCE_DIR}/Resources/Patches/dcmtk-mingw64.patch
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
80 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
81 )
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
82 endif()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
83
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
84 endif()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
85
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
86 list(REMOVE_ITEM DCMTK_SOURCES
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
87 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
88 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
89 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdictbi.cc
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
90 )
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
91
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
92 # This fixes crashes related to the destruction of the DCMTK OFLogger
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
93 # http://support.dcmtk.org/docs-snapshot/file_macros.html
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
94 add_definitions(
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
95 -DLOG4CPLUS_DISABLE_FATAL=1
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
96 -DDCMTK_VERSION_NUMBER=360
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
97 )
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
98
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
99 include_directories(
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
100 #${DCMTK_SOURCES_DIR}
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
101 ${DCMTK_SOURCES_DIR}/config/include
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
102 ${DCMTK_SOURCES_DIR}/dcmnet/include
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
103 ${DCMTK_SOURCES_DIR}/ofstd/include
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
104 ${DCMTK_SOURCES_DIR}/oflog/include
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
105 ${DCMTK_SOURCES_DIR}/dcmdata/include
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
106 )
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
107
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
108 source_group(ThirdParty\\Dcmtk REGULAR_EXPRESSION ${DCMTK_SOURCES_DIR}/.*)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
109
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
110 set(DCMTK_BUNDLES_LOG4CPLUS 1)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
111
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
112 if (STANDALONE_BUILD)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
113 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=1)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
114 else()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
115 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=0)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
116 endif()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
117
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
118 set(DCMTK_DICTIONARIES
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
119 DICTIONARY_DICOM ${DCMTK_SOURCES_DIR}/dcmdata/data/dicom.dic
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
120 DICTIONARY_PRIVATE ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
121 DICTIONARY_DICONDE ${DCMTK_SOURCES_DIR}/dcmdata/data/diconde.dic
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
122 )
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
123
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
124 else()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
125 # The following line allows to manually add libraries at the
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
126 # command-line, which is necessary for Ubuntu/Debian packages
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
127 set(tmp "${DCMTK_LIBRARIES}")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
128 include(FindDCMTK)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
129 list(APPEND DCMTK_LIBRARIES "${tmp}")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
130
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
131 include_directories(${DCMTK_INCLUDE_DIR})
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
132 link_libraries(${DCMTK_LIBRARIES})
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
133
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
134 add_definitions(
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
135 -DHAVE_CONFIG_H=1
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
136 )
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
137
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
138 if (EXISTS "${DCMTK_DIR}/config/cfunix.h")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
139 set(DCMTK_CONFIGURATION_FILE "${DCMTK_DIR}/config/cfunix.h")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
140 elseif (EXISTS "${DCMTK_DIR}/config/osconfig.h") # This is for Arch Linux
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
141 set(DCMTK_CONFIGURATION_FILE "${DCMTK_DIR}/config/osconfig.h")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
142 else()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
143 message(FATAL_ERROR "Please install libdcmtk1-dev")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
144 endif()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
145
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
146 # Autodetection of the version of DCMTK
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
147 file(STRINGS
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
148 "${DCMTK_CONFIGURATION_FILE}"
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
149 DCMTK_VERSION_NUMBER1 REGEX
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
150 ".*PACKAGE_VERSION .*")
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
151
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
152 string(REGEX REPLACE
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
153 ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$"
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
154 "\\1\\2\\3"
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
155 DCMTK_VERSION_NUMBER
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
156 ${DCMTK_VERSION_NUMBER1})
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
157
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
158 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=0)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
159
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
160 endif()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
161
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
162 add_definitions(-DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER})
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
163 message("DCMTK version: ${DCMTK_VERSION_NUMBER}")