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