Mercurial > hg > orthanc
annotate Resources/CMake/DcmtkConfiguration.cmake @ 2344:8a5c8af669cb
fix for osx
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 17 Jul 2017 23:41:31 +0200 |
parents | 157584fa9c21 |
children | 7b3b82d426ed |
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() |
2339
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
32 |
1537
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) |
2339
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
44 # If using DCMTK 3.6.0, backport the "private.dic" file from DCMTK |
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
45 # 3.6.2. This adds support for more private tags, and fixes some |
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
46 # import problems with Philips MRI Achieva. |
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
47 if (USE_DCMTK_362_PRIVATE_DIC) |
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
48 message("Using the dictionary of private tags from DCMTK 3.6.2") |
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
49 configure_file( |
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
50 ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.2-private.dic |
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
51 ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic |
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
52 COPYONLY) |
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
53 else() |
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
54 message("Using the dictionary of private tags from DCMTK 3.6.0") |
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
55 endif() |
6e26d363dc53
USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2338
diff
changeset
|
56 |
2193
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
57 # 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
|
58 execute_process( |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
59 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
|
60 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
61 RESULT_VARIABLE Failure |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
62 ) |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
63 |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
64 if (Failure) |
6ac6193a7935
fix a vulnerability in dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2186
diff
changeset
|
65 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
|
66 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
|
67 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
|
68 |
cbebc5d072b0
Use of DCMTK 3.6.1 dictionary of private tags in standalone builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2150
diff
changeset
|
69 |
1414 | 70 IF (CMAKE_CROSSCOMPILING) |
2344 | 71 if (CMAKE_COMPILER_IS_GNUCXX AND |
72 ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") # MinGW | |
73 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.") | |
74 else() | |
75 message(FATAL_ERROR "Support your platform here") | |
76 endif() | |
929 | 77 ENDIF() |
2344 | 78 |
1634 | 79 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR}) |
929 | 80 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake) |
81 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake) | |
82 | |
83 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | |
84 set(HAVE_SSTREAM 1) | |
85 set(HAVE_PROTOTYPE_BZERO 1) | |
86 set(HAVE_PROTOTYPE_GETHOSTNAME 1) | |
87 set(HAVE_PROTOTYPE_GETSOCKOPT 1) | |
88 set(HAVE_PROTOTYPE_SETSOCKOPT 1) | |
89 set(HAVE_PROTOTYPE_CONNECT 1) | |
90 set(HAVE_PROTOTYPE_BIND 1) | |
91 set(HAVE_PROTOTYPE_ACCEPT 1) | |
92 set(HAVE_PROTOTYPE_SETSOCKNAME 1) | |
93 set(HAVE_PROTOTYPE_GETSOCKNAME 1) | |
94 endif() | |
95 | |
1149
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
96 set(DCMTK_PACKAGE_VERSION_SUFFIX "") |
1634 | 97 set(DCMTK_PACKAGE_VERSION_NUMBER ${DCMTK_VERSION_NUMBER}) |
1149
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
98 |
929 | 99 CONFIGURE_FILE( |
100 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in | |
101 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h) | |
102 | |
2338
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
103 if (NOT USE_DCMTK_360) |
2344 | 104 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
105 link_libraries(netapi32) # For NetWkstaUserGetInfo@12 | |
106 link_libraries(iphlpapi) # For GetAdaptersInfo@8 | |
107 | |
108 # Configure Wine if cross-compiling for Windows | |
109 if (CMAKE_COMPILER_IS_GNUCXX) | |
110 include(${DCMTK_SOURCES_DIR}/CMake/dcmtkUseWine.cmake) | |
111 FIND_PROGRAM(WINE_WINE_PROGRAM wine) | |
112 FIND_PROGRAM(WINE_WINEPATH_PROGRAM winepath) | |
113 list(APPEND DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=-static") | |
114 endif() | |
2340 | 115 endif() |
116 | |
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
|
117 # 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
|
118 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
|
119 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
|
120 |
929 | 121 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES) |
122 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES) | |
123 | |
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
|
124 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
|
125 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
|
126 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
|
127 ${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
|
128 ) |
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
|
129 endif() |
929 | 130 |
131 if (ENABLE_JPEG) | |
132 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc DCMTK_SOURCES) | |
133 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8 DCMTK_SOURCES) | |
134 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12 DCMTK_SOURCES) | |
135 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16 DCMTK_SOURCES) | |
136 include_directories( | |
137 ${DCMTK_SOURCES_DIR}/dcmjpeg/include | |
138 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8 | |
139 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12 | |
140 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16 | |
141 ${DCMTK_SOURCES_DIR}/dcmimgle/include | |
142 ) | |
143 list(REMOVE_ITEM DCMTK_SOURCES | |
144 ${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
|
145 |
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
|
146 # 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
|
147 ${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
|
148 ${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
|
149 ${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
|
150 ${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
|
151 ${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
|
152 ${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
|
153 ${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
|
154 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencsps.cc |
929 | 155 ) |
156 endif() | |
157 | |
158 | |
159 if (ENABLE_JPEG_LOSSLESS) | |
160 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libsrc DCMTK_SOURCES) | |
161 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libcharls DCMTK_SOURCES) | |
162 include_directories( | |
163 ${DCMTK_SOURCES_DIR}/dcmjpeg/include | |
164 ${DCMTK_SOURCES_DIR}/dcmjpls/include | |
165 ${DCMTK_SOURCES_DIR}/dcmjpls/libcharls | |
166 ) | |
167 list(REMOVE_ITEM DCMTK_SOURCES | |
168 ${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
|
169 |
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
|
170 # 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
|
171 ${DCMTK_SOURCES_DIR}/dcmjpls/libsrc/djencode.cc |
929 | 172 ) |
173 list(APPEND DCMTK_SOURCES | |
174 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djrplol.cc | |
175 ) | |
176 endif() | |
177 | |
178 | |
179 # Source for the logging facility of DCMTK | |
180 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES) | |
181 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR | |
930 | 182 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR |
1337 | 183 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
929 | 184 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") |
185 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
|
186 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc |
929 | 187 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc |
188 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc | |
189 ) | |
1361
94ffb597d297
refactoring of C-Find SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1337
diff
changeset
|
190 |
1362
bf6db7d2f8b1
fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1361
diff
changeset
|
191 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
|
192 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
|
193 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
194 RESULT_VARIABLE Failure |
1362
bf6db7d2f8b1
fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1361
diff
changeset
|
195 ) |
bf6db7d2f8b1
fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1361
diff
changeset
|
196 |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
197 if (Failure AND FirstRun) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
198 message(FATAL_ERROR "Error while patching a file") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
199 endif() |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
200 |
929 | 201 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
202 list(REMOVE_ITEM DCMTK_SOURCES | |
203 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc | |
2340 | 204 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc |
929 | 205 ) |
206 | |
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
|
207 if (CMAKE_COMPILER_IS_GNUCXX AND DCMTK_PATCH_MINGW64) |
929 | 208 # This is a patch for MinGW64 |
209 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
|
210 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${DCMTK_PATCH_MINGW64} |
929 | 211 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
212 RESULT_VARIABLE Failure |
929 | 213 ) |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
214 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
215 if (Failure AND FirstRun) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
216 message(FATAL_ERROR "Error while patching a file") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
217 endif() |
929 | 218 endif() |
219 | |
1377
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
220 # This patch improves speed, even for Windows |
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
221 execute_process( |
1546 | 222 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
|
223 INPUT_FILE ${DCMTK_PATCH_SPEED} |
1377
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
224 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
225 RESULT_VARIABLE Failure |
1377
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
226 ) |
601d34afdab9
patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
227 |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
228 if (Failure AND FirstRun) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
229 message(FATAL_ERROR "Error while patching a file") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
230 endif() |
929 | 231 endif() |
232 | |
233 list(REMOVE_ITEM DCMTK_SOURCES | |
234 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc | |
235 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc | |
236 ) | |
237 | |
2338
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
238 if (USE_DCMTK_360) |
2150 | 239 # Removing this file is required with DCMTK 3.6.0 |
240 list(REMOVE_ITEM DCMTK_SOURCES | |
241 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdictbi.cc | |
242 ) | |
243 endif() | |
244 | |
1149
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
245 #set_source_files_properties(${DCMTK_SOURCES} |
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
246 # PROPERTIES COMPILE_DEFINITIONS |
1636 | 247 # "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
|
248 |
929 | 249 # This fixes crashes related to the destruction of the DCMTK OFLogger |
250 # http://support.dcmtk.org/docs-snapshot/file_macros.html | |
251 add_definitions( | |
252 -DLOG4CPLUS_DISABLE_FATAL=1 | |
1634 | 253 -DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER} |
929 | 254 ) |
255 | |
256 include_directories( | |
257 #${DCMTK_SOURCES_DIR} | |
258 ${DCMTK_SOURCES_DIR}/config/include | |
259 ${DCMTK_SOURCES_DIR}/ofstd/include | |
260 ${DCMTK_SOURCES_DIR}/oflog/include | |
261 ${DCMTK_SOURCES_DIR}/dcmdata/include | |
262 ) | |
263 | |
264 source_group(ThirdParty\\Dcmtk REGULAR_EXPRESSION ${DCMTK_SOURCES_DIR}/.*) | |
265 | |
266 set(DCMTK_BUNDLES_LOG4CPLUS 1) | |
267 | |
268 if (STANDALONE_BUILD) | |
1770 | 269 set(DCMTK_USE_EMBEDDED_DICTIONARIES 1) |
270 set(DCMTK_DICTIONARIES | |
271 DICTIONARY_DICOM ${DCMTK_SOURCES_DIR}/dcmdata/data/dicom.dic | |
272 DICTIONARY_PRIVATE ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic | |
273 DICTIONARY_DICONDE ${DCMTK_SOURCES_DIR}/dcmdata/data/diconde.dic | |
274 ) | |
929 | 275 else() |
1770 | 276 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0) |
929 | 277 endif() |
278 | |
279 else() | |
280 # The following line allows to manually add libraries at the | |
281 # command-line, which is necessary for Ubuntu/Debian packages | |
282 set(tmp "${DCMTK_LIBRARIES}") | |
283 include(FindDCMTK) | |
284 list(APPEND DCMTK_LIBRARIES "${tmp}") | |
285 | |
1943
bc949ea71fe6
Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1914
diff
changeset
|
286 include_directories(${DCMTK_INCLUDE_DIRS}) |
929 | 287 |
288 add_definitions( | |
289 -DHAVE_CONFIG_H=1 | |
290 ) | |
291 | |
1943
bc949ea71fe6
Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1914
diff
changeset
|
292 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
|
293 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
|
294 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
|
295 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
|
296 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
|
297 set(DCMTK_CONFIGURATION_FILE "${DCMTK_INCLUDE_DIRS}/dcmtk/config/osconfig.h") |
929 | 298 else() |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
299 message(FATAL_ERROR "Please install libdcmtk*-dev") |
929 | 300 endif() |
301 | |
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
|
302 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
|
303 |
929 | 304 # Autodetection of the version of DCMTK |
305 file(STRINGS | |
306 "${DCMTK_CONFIGURATION_FILE}" | |
307 DCMTK_VERSION_NUMBER1 REGEX | |
308 ".*PACKAGE_VERSION .*") | |
309 | |
310 string(REGEX REPLACE | |
311 ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$" | |
312 "\\1\\2\\3" | |
313 DCMTK_VERSION_NUMBER | |
314 ${DCMTK_VERSION_NUMBER1}) | |
315 | |
1770 | 316 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0) |
317 endif() | |
929 | 318 |
319 | |
320 add_definitions(-DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER}) | |
321 message("DCMTK version: ${DCMTK_VERSION_NUMBER}") | |
1770 | 322 |
323 | |
324 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=${DCMTK_USE_EMBEDDED_DICTIONARIES}) | |
325 if (NOT DCMTK_USE_EMBEDDED_DICTIONARIES) | |
326 # Lookup for DICOM dictionaries, if none is specified by the user | |
327 if (DCMTK_DICTIONARY_DIR STREQUAL "") | |
328 find_path(DCMTK_DICTIONARY_DIR_AUTO dicom.dic | |
329 /usr/share/dcmtk | |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
330 /usr/share/libdcmtk1 |
1770 | 331 /usr/share/libdcmtk2 |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
332 /usr/share/libdcmtk3 |
1770 | 333 /usr/share/libdcmtk4 |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
334 /usr/share/libdcmtk5 |
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
335 /usr/share/libdcmtk6 |
2064
e92280e63d8d
fix Debian #829608
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1951
diff
changeset
|
336 /usr/share/libdcmtk7 |
e92280e63d8d
fix Debian #829608
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1951
diff
changeset
|
337 /usr/share/libdcmtk8 |
e92280e63d8d
fix Debian #829608
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1951
diff
changeset
|
338 /usr/share/libdcmtk9 |
2288
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
339 /usr/share/libdcmtk10 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
340 /usr/share/libdcmtk11 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
341 /usr/share/libdcmtk12 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
342 /usr/share/libdcmtk13 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
343 /usr/share/libdcmtk14 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
344 /usr/share/libdcmtk15 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
345 /usr/share/libdcmtk16 |
1770 | 346 /usr/local/share/dcmtk |
347 ) | |
348 | |
349 if (${DCMTK_DICTIONARY_DIR_AUTO} MATCHES "DCMTK_DICTIONARY_DIR_AUTO-NOTFOUND") | |
350 message(FATAL_ERROR "Cannot locate the DICOM dictionary on this system") | |
351 endif() | |
352 | |
353 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}") | |
354 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}") | |
355 else() | |
356 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}") | |
357 endif() | |
358 endif() |