Mercurial > hg > orthanc
annotate Resources/CMake/DcmtkConfiguration.cmake @ 1943:bc949ea71fe6
Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 04 Apr 2016 13:17:08 +0200 |
parents | 501769757bf9 |
children | 01de36d949c3 |
rev | line source |
---|---|
1914
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
1 if (NOT DEFINED ENABLE_DCMTK_NETWORKING) |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
2 set(ENABLE_DCMTK_NETWORKING ON) |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
3 endif() |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
4 |
929 | 5 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK) |
6 SET(DCMTK_VERSION_NUMBER 360) | |
1846
3dcf5c0734c9
New "AgfaImpax" modality manufacturer for AGFA Impax
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1770
diff
changeset
|
7 SET(DCMTK_PACKAGE_VERSION "3.6.0") |
929 | 8 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0) |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
9 SET(DCMTK_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.0.zip") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
10 SET(DCMTK_MD5 "219ad631b82031806147e4abbfba4fa4") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
11 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
12 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
13 set(FirstRun OFF) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
14 else() |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
15 set(FirstRun ON) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
16 endif() |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
17 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
18 DownloadPackage(${DCMTK_MD5} ${DCMTK_URL} "${DCMTK_SOURCES_DIR}") |
929 | 19 |
1414 | 20 IF (CMAKE_CROSSCOMPILING) |
929 | 21 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.") |
22 ENDIF() | |
1634 | 23 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR}) |
929 | 24 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake) |
25 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake) | |
26 | |
27 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | |
28 set(HAVE_SSTREAM 1) | |
29 set(HAVE_PROTOTYPE_BZERO 1) | |
30 set(HAVE_PROTOTYPE_GETHOSTNAME 1) | |
31 set(HAVE_PROTOTYPE_GETSOCKOPT 1) | |
32 set(HAVE_PROTOTYPE_SETSOCKOPT 1) | |
33 set(HAVE_PROTOTYPE_CONNECT 1) | |
34 set(HAVE_PROTOTYPE_BIND 1) | |
35 set(HAVE_PROTOTYPE_ACCEPT 1) | |
36 set(HAVE_PROTOTYPE_SETSOCKNAME 1) | |
37 set(HAVE_PROTOTYPE_GETSOCKNAME 1) | |
38 endif() | |
39 | |
1149
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
40 set(DCMTK_PACKAGE_VERSION_SUFFIX "") |
1634 | 41 set(DCMTK_PACKAGE_VERSION_NUMBER ${DCMTK_VERSION_NUMBER}) |
1149
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
42 |
929 | 43 CONFIGURE_FILE( |
44 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in | |
45 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h) | |
46 | |
47 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES) | |
48 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES) | |
49 | |
1914
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
50 if (ENABLE_DCMTK_NETWORKING) |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
51 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmnet/libsrc DCMTK_SOURCES) |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
52 include_directories( |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
53 ${DCMTK_SOURCES_DIR}/dcmnet/include |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
54 ) |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
55 endif() |
929 | 56 |
57 if (ENABLE_JPEG) | |
58 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc DCMTK_SOURCES) | |
59 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8 DCMTK_SOURCES) | |
60 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12 DCMTK_SOURCES) | |
61 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16 DCMTK_SOURCES) | |
62 include_directories( | |
63 ${DCMTK_SOURCES_DIR}/dcmjpeg/include | |
64 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8 | |
65 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12 | |
66 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16 | |
67 ${DCMTK_SOURCES_DIR}/dcmimgle/include | |
68 ) | |
69 list(REMOVE_ITEM DCMTK_SOURCES | |
70 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/ddpiimpl.cc | |
1914
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
71 |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
72 # Disable support for encoding JPEG (modification in Orthanc 1.0.1) |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
73 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djcodece.cc |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
74 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencsv1.cc |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
75 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencbas.cc |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
76 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencpro.cc |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
77 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djenclol.cc |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
78 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencode.cc |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
79 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencext.cc |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
80 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencsps.cc |
929 | 81 ) |
82 endif() | |
83 | |
84 | |
85 if (ENABLE_JPEG_LOSSLESS) | |
86 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libsrc DCMTK_SOURCES) | |
87 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libcharls DCMTK_SOURCES) | |
88 include_directories( | |
89 ${DCMTK_SOURCES_DIR}/dcmjpeg/include | |
90 ${DCMTK_SOURCES_DIR}/dcmjpls/include | |
91 ${DCMTK_SOURCES_DIR}/dcmjpls/libcharls | |
92 ) | |
93 list(REMOVE_ITEM DCMTK_SOURCES | |
94 ${DCMTK_SOURCES_DIR}/dcmjpls/libsrc/djcodece.cc | |
1914
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
95 |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
96 # Disable support for encoding JPEG-LS (modification in Orthanc 1.0.1) |
501769757bf9
flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1883
diff
changeset
|
97 ${DCMTK_SOURCES_DIR}/dcmjpls/libsrc/djencode.cc |
929 | 98 ) |
99 list(APPEND DCMTK_SOURCES | |
100 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djrplol.cc | |
101 ) | |
102 endif() | |
103 | |
104 | |
105 # Source for the logging facility of DCMTK | |
106 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES) | |
107 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR | |
930 | 108 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR |
1337 | 109 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
929 | 110 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") |
111 list(REMOVE_ITEM DCMTK_SOURCES | |
112 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc | |
113 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc | |
114 ) | |
1361
94ffb597d297
refactoring of C-Find SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1337
diff
changeset
|
115 |
1362
bf6db7d2f8b1
fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1361
diff
changeset
|
116 execute_process( |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
117 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${ORTHANC_ROOT}/Resources/Patches/dcmtk-linux-speed.patch |
1362
bf6db7d2f8b1
fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1361
diff
changeset
|
118 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
119 RESULT_VARIABLE Failure |
1362
bf6db7d2f8b1
fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1361
diff
changeset
|
120 ) |
bf6db7d2f8b1
fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1361
diff
changeset
|
121 |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
122 if (Failure AND FirstRun) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
123 message(FATAL_ERROR "Error while patching a file") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
124 endif() |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
125 |
929 | 126 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
127 list(REMOVE_ITEM DCMTK_SOURCES | |
128 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc | |
129 ) | |
130 | |
1415 | 131 if (CMAKE_COMPILER_IS_GNUCXX) |
929 | 132 # This is a patch for MinGW64 |
133 execute_process( | |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
134 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${ORTHANC_ROOT}/Resources/Patches/dcmtk-mingw64.patch |
929 | 135 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
136 RESULT_VARIABLE Failure |
929 | 137 ) |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
138 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
139 if (Failure AND FirstRun) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
140 message(FATAL_ERROR "Error while patching a file") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
141 endif() |
929 | 142 endif() |
143 | |
1377
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
144 # This patch improves speed, even for Windows |
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
145 execute_process( |
1546 | 146 COMMAND ${PATCH_EXECUTABLE} -p0 -N |
147 INPUT_FILE ${ORTHANC_ROOT}/Resources/Patches/dcmtk-linux-speed.patch | |
1377
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
148 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
149 RESULT_VARIABLE Failure |
1377
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
150 ) |
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
151 |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
152 if (Failure AND FirstRun) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
153 message(FATAL_ERROR "Error while patching a file") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
154 endif() |
929 | 155 endif() |
156 | |
157 list(REMOVE_ITEM DCMTK_SOURCES | |
158 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc | |
159 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc | |
160 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdictbi.cc | |
161 ) | |
162 | |
1149
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
163 #set_source_files_properties(${DCMTK_SOURCES} |
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
164 # PROPERTIES COMPILE_DEFINITIONS |
1636 | 165 # "PACKAGE_VERSION=\"${DCMTK_PACKAGE_VERSION}\";PACKAGE_VERSION_NUMBER=\"${DCMTK_VERSION_NUMBER}\"") |
1149
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
166 |
929 | 167 # This fixes crashes related to the destruction of the DCMTK OFLogger |
168 # http://support.dcmtk.org/docs-snapshot/file_macros.html | |
169 add_definitions( | |
170 -DLOG4CPLUS_DISABLE_FATAL=1 | |
1634 | 171 -DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER} |
929 | 172 ) |
173 | |
174 include_directories( | |
175 #${DCMTK_SOURCES_DIR} | |
176 ${DCMTK_SOURCES_DIR}/config/include | |
177 ${DCMTK_SOURCES_DIR}/ofstd/include | |
178 ${DCMTK_SOURCES_DIR}/oflog/include | |
179 ${DCMTK_SOURCES_DIR}/dcmdata/include | |
180 ) | |
181 | |
182 source_group(ThirdParty\\Dcmtk REGULAR_EXPRESSION ${DCMTK_SOURCES_DIR}/.*) | |
183 | |
184 set(DCMTK_BUNDLES_LOG4CPLUS 1) | |
185 | |
186 if (STANDALONE_BUILD) | |
1770 | 187 set(DCMTK_USE_EMBEDDED_DICTIONARIES 1) |
188 set(DCMTK_DICTIONARIES | |
189 DICTIONARY_DICOM ${DCMTK_SOURCES_DIR}/dcmdata/data/dicom.dic | |
190 DICTIONARY_PRIVATE ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic | |
191 DICTIONARY_DICONDE ${DCMTK_SOURCES_DIR}/dcmdata/data/diconde.dic | |
192 ) | |
929 | 193 else() |
1770 | 194 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0) |
929 | 195 endif() |
196 | |
197 else() | |
198 # The following line allows to manually add libraries at the | |
199 # command-line, which is necessary for Ubuntu/Debian packages | |
200 set(tmp "${DCMTK_LIBRARIES}") | |
201 include(FindDCMTK) | |
202 list(APPEND DCMTK_LIBRARIES "${tmp}") | |
203 | |
1943
bc949ea71fe6
Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1914
diff
changeset
|
204 include_directories(${DCMTK_INCLUDE_DIRS}) |
929 | 205 |
206 add_definitions( | |
207 -DHAVE_CONFIG_H=1 | |
208 ) | |
209 | |
1943
bc949ea71fe6
Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1914
diff
changeset
|
210 if (EXISTS "${DCMTK_config_INCLUDE_DIR}/cfunix.h") |
bc949ea71fe6
Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1914
diff
changeset
|
211 set(DCMTK_CONFIGURATION_FILE "${DCMTK_config_INCLUDE_DIR}/cfunix.h") |
bc949ea71fe6
Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1914
diff
changeset
|
212 elseif (EXISTS "${DCMTK_config_INCLUDE_DIR}/osconfig.h") # This is for Arch Linux |
bc949ea71fe6
Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1914
diff
changeset
|
213 set(DCMTK_CONFIGURATION_FILE "${DCMTK_config_INCLUDE_DIR}/osconfig.h") |
929 | 214 else() |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
215 message(FATAL_ERROR "Please install libdcmtk*-dev") |
929 | 216 endif() |
217 | |
218 # Autodetection of the version of DCMTK | |
219 file(STRINGS | |
220 "${DCMTK_CONFIGURATION_FILE}" | |
221 DCMTK_VERSION_NUMBER1 REGEX | |
222 ".*PACKAGE_VERSION .*") | |
223 | |
224 string(REGEX REPLACE | |
225 ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$" | |
226 "\\1\\2\\3" | |
227 DCMTK_VERSION_NUMBER | |
228 ${DCMTK_VERSION_NUMBER1}) | |
229 | |
1770 | 230 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0) |
231 endif() | |
929 | 232 |
233 | |
234 add_definitions(-DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER}) | |
235 message("DCMTK version: ${DCMTK_VERSION_NUMBER}") | |
1770 | 236 |
237 | |
238 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=${DCMTK_USE_EMBEDDED_DICTIONARIES}) | |
239 if (NOT DCMTK_USE_EMBEDDED_DICTIONARIES) | |
240 # Lookup for DICOM dictionaries, if none is specified by the user | |
241 if (DCMTK_DICTIONARY_DIR STREQUAL "") | |
242 find_path(DCMTK_DICTIONARY_DIR_AUTO dicom.dic | |
243 /usr/share/dcmtk | |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
244 /usr/share/libdcmtk1 |
1770 | 245 /usr/share/libdcmtk2 |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
246 /usr/share/libdcmtk3 |
1770 | 247 /usr/share/libdcmtk4 |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
248 /usr/share/libdcmtk5 |
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
249 /usr/share/libdcmtk6 |
1770 | 250 /usr/local/share/dcmtk |
251 ) | |
252 | |
253 if (${DCMTK_DICTIONARY_DIR_AUTO} MATCHES "DCMTK_DICTIONARY_DIR_AUTO-NOTFOUND") | |
254 message(FATAL_ERROR "Cannot locate the DICOM dictionary on this system") | |
255 endif() | |
256 | |
257 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}") | |
258 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}") | |
259 else() | |
260 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}") | |
261 endif() | |
262 endif() |