Mercurial > hg > orthanc
annotate Resources/CMake/DcmtkConfiguration.cmake @ 2338:86a99fd1bbfb
switch to just-released dcmtk 3.6.2
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 17 Jul 2017 18:49:45 +0200 |
parents | 46a312152744 |
children | 6e26d363dc53 |
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) |
2338
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
6 if (USE_DCMTK_360) |
1951
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
7 SET(DCMTK_VERSION_NUMBER 360) |
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
8 SET(DCMTK_PACKAGE_VERSION "3.6.0") |
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
9 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0) |
2186
8b51b133bb8b
move of third party downloads to the main server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2157
diff
changeset
|
10 SET(DCMTK_URL "http://www.orthanc-server.com/downloads/third-party/dcmtk-3.6.0.zip") |
1951
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
11 SET(DCMTK_MD5 "219ad631b82031806147e4abbfba4fa4") |
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
12 SET(DCMTK_PATCH_SPEED "${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.0-speed.patch") |
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
13 SET(DCMTK_PATCH_MINGW64 "${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.0-mingw64.patch") |
2338
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
14 else() |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
15 SET(DCMTK_VERSION_NUMBER 362) |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
16 SET(DCMTK_PACKAGE_VERSION "3.6.2") |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
17 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.2) |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
18 SET(DCMTK_URL "http://www.orthanc-server.com/downloads/third-party/dcmtk-3.6.2.tar.gz") |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
19 SET(DCMTK_MD5 "d219a4152772985191c9b89d75302d12") |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
20 SET(DCMTK_PATCH_SPEED "${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.2-speed.patch") |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
21 |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
22 macro(DCMTK_UNSET) |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
23 endmacro() |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
24 |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
25 macro(DCMTK_UNSET_CACHE) |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
26 endmacro() |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
27 |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
28 set(DCMTK_BINARY_DIR ${DCMTK_SOURCES_DIR}/) |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
29 set(DCMTK_CMAKE_INCLUDE ${DCMTK_SOURCES_DIR}/) |
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
30 add_definitions(-DDCMTK_INSIDE_LOG4CPLUS=1) |
1951
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
31 endif() |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
32 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
33 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
34 set(FirstRun OFF) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
35 else() |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
36 set(FirstRun ON) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
37 endif() |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
38 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
39 DownloadPackage(${DCMTK_MD5} ${DCMTK_URL} "${DCMTK_SOURCES_DIR}") |
929 | 40 |
2152
cbebc5d072b0
Use of DCMTK 3.6.1 dictionary of private tags in standalone builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2150
diff
changeset
|
41 |
2157
f75611abd407
cmake option USE_DCMTK_361_PRIVATE_DIC
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2152
diff
changeset
|
42 if (FirstRun AND |
2338
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
43 USE_DCMTK_360) |
2193
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
44 # Patches specific to DCMTK 3.6.0 |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
45 execute_process( |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
46 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.0-dulparse-vulnerability.patch |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
47 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
48 RESULT_VARIABLE Failure |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
49 ) |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
50 |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
51 if (Failure) |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
52 message(FATAL_ERROR "Error while patching a file") |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
53 endif() |
2152
cbebc5d072b0
Use of DCMTK 3.6.1 dictionary of private tags in standalone builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2150
diff
changeset
|
54 endif() |
cbebc5d072b0
Use of DCMTK 3.6.1 dictionary of private tags in standalone builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2150
diff
changeset
|
55 |
cbebc5d072b0
Use of DCMTK 3.6.1 dictionary of private tags in standalone builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2150
diff
changeset
|
56 |
1414 | 57 IF (CMAKE_CROSSCOMPILING) |
929 | 58 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.") |
59 ENDIF() | |
1634 | 60 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR}) |
929 | 61 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake) |
62 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake) | |
63 | |
64 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | |
65 set(HAVE_SSTREAM 1) | |
66 set(HAVE_PROTOTYPE_BZERO 1) | |
67 set(HAVE_PROTOTYPE_GETHOSTNAME 1) | |
68 set(HAVE_PROTOTYPE_GETSOCKOPT 1) | |
69 set(HAVE_PROTOTYPE_SETSOCKOPT 1) | |
70 set(HAVE_PROTOTYPE_CONNECT 1) | |
71 set(HAVE_PROTOTYPE_BIND 1) | |
72 set(HAVE_PROTOTYPE_ACCEPT 1) | |
73 set(HAVE_PROTOTYPE_SETSOCKNAME 1) | |
74 set(HAVE_PROTOTYPE_GETSOCKNAME 1) | |
75 endif() | |
76 | |
1149
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
77 set(DCMTK_PACKAGE_VERSION_SUFFIX "") |
1634 | 78 set(DCMTK_PACKAGE_VERSION_NUMBER ${DCMTK_VERSION_NUMBER}) |
1149
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
79 |
929 | 80 CONFIGURE_FILE( |
81 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in | |
82 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h) | |
83 | |
2338
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
84 if (NOT USE_DCMTK_360) |
1951
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
85 # This step must be after the generation of "osconfig.h" |
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
86 INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES() |
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
87 endif() |
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
88 |
929 | 89 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES) |
90 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES) | |
91 | |
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
|
92 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
|
93 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
|
94 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
|
95 ${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
|
96 ) |
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 endif() |
929 | 98 |
99 if (ENABLE_JPEG) | |
100 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc DCMTK_SOURCES) | |
101 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8 DCMTK_SOURCES) | |
102 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12 DCMTK_SOURCES) | |
103 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16 DCMTK_SOURCES) | |
104 include_directories( | |
105 ${DCMTK_SOURCES_DIR}/dcmjpeg/include | |
106 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8 | |
107 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12 | |
108 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16 | |
109 ${DCMTK_SOURCES_DIR}/dcmimgle/include | |
110 ) | |
111 list(REMOVE_ITEM DCMTK_SOURCES | |
112 ${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
|
113 |
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
|
114 # 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
|
115 ${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
|
116 ${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
|
117 ${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
|
118 ${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
|
119 ${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
|
120 ${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
|
121 ${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
|
122 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencsps.cc |
929 | 123 ) |
124 endif() | |
125 | |
126 | |
127 if (ENABLE_JPEG_LOSSLESS) | |
128 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libsrc DCMTK_SOURCES) | |
129 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libcharls DCMTK_SOURCES) | |
130 include_directories( | |
131 ${DCMTK_SOURCES_DIR}/dcmjpeg/include | |
132 ${DCMTK_SOURCES_DIR}/dcmjpls/include | |
133 ${DCMTK_SOURCES_DIR}/dcmjpls/libcharls | |
134 ) | |
135 list(REMOVE_ITEM DCMTK_SOURCES | |
136 ${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
|
137 |
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
|
138 # 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
|
139 ${DCMTK_SOURCES_DIR}/dcmjpls/libsrc/djencode.cc |
929 | 140 ) |
141 list(APPEND DCMTK_SOURCES | |
142 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djrplol.cc | |
143 ) | |
144 endif() | |
145 | |
146 | |
147 # Source for the logging facility of DCMTK | |
148 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES) | |
149 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR | |
930 | 150 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR |
1337 | 151 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
929 | 152 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") |
153 list(REMOVE_ITEM DCMTK_SOURCES | |
1951
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
154 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc |
929 | 155 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc |
156 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc | |
157 ) | |
1361
94ffb597d297
refactoring of C-Find SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1337
diff
changeset
|
158 |
1362
bf6db7d2f8b1
fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1361
diff
changeset
|
159 execute_process( |
1951
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
160 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${DCMTK_PATCH_SPEED} |
1362
bf6db7d2f8b1
fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1361
diff
changeset
|
161 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
162 RESULT_VARIABLE Failure |
1362
bf6db7d2f8b1
fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1361
diff
changeset
|
163 ) |
bf6db7d2f8b1
fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1361
diff
changeset
|
164 |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
165 if (Failure AND FirstRun) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
166 message(FATAL_ERROR "Error while patching a file") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
167 endif() |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
168 |
929 | 169 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
170 list(REMOVE_ITEM DCMTK_SOURCES | |
171 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc | |
172 ) | |
173 | |
1951
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
174 if (CMAKE_COMPILER_IS_GNUCXX AND DCMTK_PATCH_MINGW64) |
929 | 175 # This is a patch for MinGW64 |
176 execute_process( | |
1951
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
177 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${DCMTK_PATCH_MINGW64} |
929 | 178 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
179 RESULT_VARIABLE Failure |
929 | 180 ) |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
181 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
182 if (Failure AND FirstRun) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
183 message(FATAL_ERROR "Error while patching a file") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
184 endif() |
929 | 185 endif() |
186 | |
1377
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
187 # This patch improves speed, even for Windows |
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
188 execute_process( |
1546 | 189 COMMAND ${PATCH_EXECUTABLE} -p0 -N |
1951
01de36d949c3
Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1943
diff
changeset
|
190 INPUT_FILE ${DCMTK_PATCH_SPEED} |
1377
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
191 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
192 RESULT_VARIABLE Failure |
1377
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
193 ) |
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
194 |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
195 if (Failure AND FirstRun) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
196 message(FATAL_ERROR "Error while patching a file") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
197 endif() |
929 | 198 endif() |
199 | |
200 list(REMOVE_ITEM DCMTK_SOURCES | |
201 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc | |
202 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc | |
203 ) | |
204 | |
2338
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
205 if (USE_DCMTK_360) |
2150 | 206 # Removing this file is required with DCMTK 3.6.0 |
207 list(REMOVE_ITEM DCMTK_SOURCES | |
208 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdictbi.cc | |
209 ) | |
210 endif() | |
211 | |
1149
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
212 #set_source_files_properties(${DCMTK_SOURCES} |
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
213 # PROPERTIES COMPILE_DEFINITIONS |
1636 | 214 # "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
|
215 |
929 | 216 # This fixes crashes related to the destruction of the DCMTK OFLogger |
217 # http://support.dcmtk.org/docs-snapshot/file_macros.html | |
218 add_definitions( | |
219 -DLOG4CPLUS_DISABLE_FATAL=1 | |
1634 | 220 -DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER} |
929 | 221 ) |
222 | |
223 include_directories( | |
224 #${DCMTK_SOURCES_DIR} | |
225 ${DCMTK_SOURCES_DIR}/config/include | |
226 ${DCMTK_SOURCES_DIR}/ofstd/include | |
227 ${DCMTK_SOURCES_DIR}/oflog/include | |
228 ${DCMTK_SOURCES_DIR}/dcmdata/include | |
229 ) | |
230 | |
231 source_group(ThirdParty\\Dcmtk REGULAR_EXPRESSION ${DCMTK_SOURCES_DIR}/.*) | |
232 | |
233 set(DCMTK_BUNDLES_LOG4CPLUS 1) | |
234 | |
235 if (STANDALONE_BUILD) | |
1770 | 236 set(DCMTK_USE_EMBEDDED_DICTIONARIES 1) |
237 set(DCMTK_DICTIONARIES | |
238 DICTIONARY_DICOM ${DCMTK_SOURCES_DIR}/dcmdata/data/dicom.dic | |
239 DICTIONARY_PRIVATE ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic | |
240 DICTIONARY_DICONDE ${DCMTK_SOURCES_DIR}/dcmdata/data/diconde.dic | |
241 ) | |
929 | 242 else() |
1770 | 243 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0) |
929 | 244 endif() |
245 | |
246 else() | |
247 # The following line allows to manually add libraries at the | |
248 # command-line, which is necessary for Ubuntu/Debian packages | |
249 set(tmp "${DCMTK_LIBRARIES}") | |
250 include(FindDCMTK) | |
251 list(APPEND DCMTK_LIBRARIES "${tmp}") | |
252 | |
1943
bc949ea71fe6
Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1914
diff
changeset
|
253 include_directories(${DCMTK_INCLUDE_DIRS}) |
929 | 254 |
255 add_definitions( | |
256 -DHAVE_CONFIG_H=1 | |
257 ) | |
258 | |
1943
bc949ea71fe6
Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1914
diff
changeset
|
259 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
|
260 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
|
261 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
|
262 set(DCMTK_CONFIGURATION_FILE "${DCMTK_config_INCLUDE_DIR}/osconfig.h") |
2287
9f3414878c02
Fix Debian #865606 (orthanc FTBFS with libdcmtk-dev 3.6.1~20170228-2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2193
diff
changeset
|
263 elseif (EXISTS "${DCMTK_INCLUDE_DIRS}/dcmtk/config/osconfig.h") # This is for Debian Buster |
9f3414878c02
Fix Debian #865606 (orthanc FTBFS with libdcmtk-dev 3.6.1~20170228-2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2193
diff
changeset
|
264 set(DCMTK_CONFIGURATION_FILE "${DCMTK_INCLUDE_DIRS}/dcmtk/config/osconfig.h") |
929 | 265 else() |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
266 message(FATAL_ERROR "Please install libdcmtk*-dev") |
929 | 267 endif() |
268 | |
2287
9f3414878c02
Fix Debian #865606 (orthanc FTBFS with libdcmtk-dev 3.6.1~20170228-2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2193
diff
changeset
|
269 message("DCMTK configuration file: ${DCMTK_CONFIGURATION_FILE}") |
9f3414878c02
Fix Debian #865606 (orthanc FTBFS with libdcmtk-dev 3.6.1~20170228-2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2193
diff
changeset
|
270 |
929 | 271 # Autodetection of the version of DCMTK |
272 file(STRINGS | |
273 "${DCMTK_CONFIGURATION_FILE}" | |
274 DCMTK_VERSION_NUMBER1 REGEX | |
275 ".*PACKAGE_VERSION .*") | |
276 | |
277 string(REGEX REPLACE | |
278 ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$" | |
279 "\\1\\2\\3" | |
280 DCMTK_VERSION_NUMBER | |
281 ${DCMTK_VERSION_NUMBER1}) | |
282 | |
1770 | 283 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0) |
284 endif() | |
929 | 285 |
286 | |
287 add_definitions(-DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER}) | |
288 message("DCMTK version: ${DCMTK_VERSION_NUMBER}") | |
1770 | 289 |
290 | |
291 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=${DCMTK_USE_EMBEDDED_DICTIONARIES}) | |
292 if (NOT DCMTK_USE_EMBEDDED_DICTIONARIES) | |
293 # Lookup for DICOM dictionaries, if none is specified by the user | |
294 if (DCMTK_DICTIONARY_DIR STREQUAL "") | |
295 find_path(DCMTK_DICTIONARY_DIR_AUTO dicom.dic | |
296 /usr/share/dcmtk | |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
297 /usr/share/libdcmtk1 |
1770 | 298 /usr/share/libdcmtk2 |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
299 /usr/share/libdcmtk3 |
1770 | 300 /usr/share/libdcmtk4 |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
301 /usr/share/libdcmtk5 |
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
302 /usr/share/libdcmtk6 |
2064
e92280e63d8d
fix Debian #829608
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1951
diff
changeset
|
303 /usr/share/libdcmtk7 |
e92280e63d8d
fix Debian #829608
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1951
diff
changeset
|
304 /usr/share/libdcmtk8 |
e92280e63d8d
fix Debian #829608
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1951
diff
changeset
|
305 /usr/share/libdcmtk9 |
2288
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
306 /usr/share/libdcmtk10 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
307 /usr/share/libdcmtk11 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
308 /usr/share/libdcmtk12 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
309 /usr/share/libdcmtk13 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
310 /usr/share/libdcmtk14 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
311 /usr/share/libdcmtk15 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
312 /usr/share/libdcmtk16 |
1770 | 313 /usr/local/share/dcmtk |
314 ) | |
315 | |
316 if (${DCMTK_DICTIONARY_DIR_AUTO} MATCHES "DCMTK_DICTIONARY_DIR_AUTO-NOTFOUND") | |
317 message(FATAL_ERROR "Cannot locate the DICOM dictionary on this system") | |
318 endif() | |
319 | |
320 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}") | |
321 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}") | |
322 else() | |
323 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}") | |
324 endif() | |
325 endif() |