Mercurial > hg > orthanc
annotate OrthancFramework/Resources/CMake/DcmtkConfigurationStatic-3.6.0.cmake @ 4836:ec1e9571b645
document number of dimensions in numpy arrays
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 27 Nov 2021 12:31:51 +0100 |
parents | 7053502fbf97 |
children | 43e613a7756b |
rev | line source |
---|---|
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
1 # Orthanc - A Lightweight, RESTful DICOM Store |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
4437
d9473bd5ed43
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4120
diff
changeset
|
4 # Copyright (C) 2017-2021 Osimis S.A., Belgium |
4831
7053502fbf97
added copyright UCLouvain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4437
diff
changeset
|
5 # Copyright (C) 2021-2021 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
6 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
7 # This program is free software: you can redistribute it and/or |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
8 # modify it under the terms of the GNU Lesser General Public License |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
9 # as published by the Free Software Foundation, either version 3 of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
10 # the License, or (at your option) any later version. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
11 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
12 # This program is distributed in the hope that it will be useful, but |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
13 # WITHOUT ANY WARRANTY; without even the implied warranty of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
15 # Lesser General Public License for more details. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
16 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
17 # You should have received a copy of the GNU Lesser General Public |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
18 # License along with this program. If not, see |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
19 # <http://www.gnu.org/licenses/>. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
20 |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
21 |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 SET(DCMTK_VERSION_NUMBER 360) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 SET(DCMTK_PACKAGE_VERSION "3.6.0") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 SET(DCMTK_URL "http://orthanc.osimis.io/ThirdPartyDownloads/dcmtk-3.6.0.zip") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 SET(DCMTK_MD5 "219ad631b82031806147e4abbfba4fa4") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 set(FirstRun OFF) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 else() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 set(FirstRun ON) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 DownloadPackage(${DCMTK_MD5} ${DCMTK_URL} "${DCMTK_SOURCES_DIR}") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 if (FirstRun) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 # If using DCMTK 3.6.0, backport the "private.dic" file from DCMTK |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 # 3.6.2. This adds support for more private tags, and fixes some |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 # import problems with Philips MRI Achieva. |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 if (USE_DCMTK_362_PRIVATE_DIC) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 message("Using the dictionary of private tags from DCMTK 3.6.2") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 configure_file( |
4045 | 44 ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-3.6.2-private.dic |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 COPYONLY) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 else() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 message("Using the dictionary of private tags from DCMTK 3.6.0") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 # Patches specific to DCMTK 3.6.0 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 message("Applying patch to solve vulnerability in DCMTK 3.6.0") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 execute_process( |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i |
4045 | 55 ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-3.6.0-dulparse-vulnerability.patch |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 RESULT_VARIABLE Failure |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 ) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 if (Failure) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 message(FATAL_ERROR "Error while patching a file") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 # This patch is not needed anymore thanks to the following commit |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 # (information sent by Jorg Riesmeier on Twitter on 2017-07-19): |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 # http://git.dcmtk.org/?p=dcmtk.git;a=commit;h=8df1f5e517b8629ae09088d0935c2a8dd333c76f |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 message("Applying patch for speed in DCMTK 3.6.0") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 execute_process( |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i |
4045 | 70 ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-3.6.0-speed.patch |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 RESULT_VARIABLE Failure |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 ) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 if (Failure) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 message(FATAL_ERROR "Error while patching a file") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 else() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 message("The patches for DCMTK have already been applied") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 # C_CHAR_UNSIGNED *must* be set before calling "GenerateDCMTKConfigure.cmake" |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 IF (CMAKE_CROSSCOMPILING) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 if (CMAKE_COMPILER_IS_GNUCXX AND |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 CMAKE_SYSTEM_NAME STREQUAL "Windows") # MinGW |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 elseif(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # WebAssembly or asm.js |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 # Check out "../WebAssembly/ArithmeticTests/" to regenerate the |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 # "arith.h" file |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 configure_file( |
4045 | 94 ${CMAKE_CURRENT_LIST_DIR}/WebAssembly/arith.h |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/arith.h |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 COPYONLY) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 UNSET(C_CHAR_UNSIGNED CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 SET(C_CHAR_UNSIGNED 0 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 else() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 message(FATAL_ERROR "Support your platform here") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 ENDIF() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 SET(DCMTK_ENABLE_CHARSET_CONVERSION "iconv" CACHE STRING "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 SET(HAVE_SYS_GETTID 0 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 execute_process( |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
112 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i |
4045 | 113 ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-3.6.2-linux-standard-base.patch |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 RESULT_VARIABLE Failure |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 ) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 if (FirstRun AND Failure) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 message(FATAL_ERROR "Error while patching a file") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR}) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # WebAssembly or |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 # asm.js The macros below are not properly discovered by DCMTK |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 # when using WebAssembly. Check out "../WebAssembly/arith.h" for |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 # how we produced these values. This step MUST be after |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 # "GenerateDCMTKConfigure" and before the generation of |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 # "osconfig.h". |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 UNSET(SIZEOF_VOID_P CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 UNSET(SIZEOF_CHAR CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 UNSET(SIZEOF_DOUBLE CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 UNSET(SIZEOF_FLOAT CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 UNSET(SIZEOF_INT CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 UNSET(SIZEOF_LONG CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 UNSET(SIZEOF_SHORT CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 UNSET(SIZEOF_VOID_P CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 SET(SIZEOF_CHAR 1 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 SET(SIZEOF_DOUBLE 8 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 SET(SIZEOF_FLOAT 4 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 SET(SIZEOF_INT 4 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
148 SET(SIZEOF_LONG 4 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 SET(SIZEOF_SHORT 2 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 set(DCMTK_PACKAGE_VERSION_SUFFIX "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 set(DCMTK_PACKAGE_VERSION_NUMBER ${DCMTK_VERSION_NUMBER}) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 CONFIGURE_FILE( |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
160 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 # Source for the logging facility of DCMTK |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
164 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
165 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
166 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
167 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
169 ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" OR |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
170 ${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 list(REMOVE_ITEM DCMTK_SOURCES |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
173 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
174 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 ) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
176 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
177 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 list(REMOVE_ITEM DCMTK_SOURCES |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
179 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
180 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
181 ) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
182 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
183 if (CMAKE_COMPILER_IS_GNUCXX) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
184 # This is a patch for DCMTK 3.6.0 and MinGW64 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 execute_process( |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i |
4045 | 187 ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-3.6.0-mingw64.patch |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
188 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 RESULT_VARIABLE Failure |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
190 ) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
191 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
192 if (Failure AND FirstRun) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
193 message(FATAL_ERROR "Error while patching a file") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
194 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
195 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
196 endif() |