Mercurial > hg > orthanc
annotate OrthancFramework/Resources/CMake/DcmtkConfigurationStatic-3.6.8.cmake @ 5579:77570cce8855 find-refactoring
removed redundant FindResponse::resourceId_
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 27 Apr 2024 11:31:39 +0200 |
parents | 0a74634073c0 |
children | f7adfb22e20e |
rev | line source |
---|---|
5487
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 # Orthanc - A Lightweight, RESTful DICOM Store |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 # Copyright (C) 2017-2024 Osimis S.A., Belgium |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 # |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 # This program is free software: you can redistribute it and/or |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 # modify it under the terms of the GNU Lesser General Public License |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 # as published by the Free Software Foundation, either version 3 of |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 # the License, or (at your option) any later version. |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 # |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 # This program is distributed in the hope that it will be useful, but |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 # WITHOUT ANY WARRANTY; without even the implied warranty of |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 # Lesser General Public License for more details. |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 # |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 # You should have received a copy of the GNU Lesser General Public |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 # License along with this program. If not, see |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 # <http://www.gnu.org/licenses/>. |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 SET(DCMTK_VERSION_NUMBER 368) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 SET(DCMTK_PACKAGE_VERSION "3.6.8") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-DCMTK-3.6.8) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 SET(DCMTK_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/dcmtk-3.6.8.tar.gz") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 SET(DCMTK_MD5 "ce3e878c05165f1a3322c29e67f2426f") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 macro(DCMTK_UNSET) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 endmacro() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 macro(DCMTK_UNSET_CACHE) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 endmacro() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 set(DCMTK_BINARY_DIR ${DCMTK_SOURCES_DIR}/) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 set(DCMTK_CMAKE_INCLUDE ${DCMTK_SOURCES_DIR}/) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 set(DCMTK_WITH_THREADS OFF) # Disable thread support in wasm/asm.js |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 else() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 set(DCMTK_WITH_THREADS ON) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 add_definitions(-DDCMTK_INSIDE_LOG4CPLUS=1) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 set(FirstRun OFF) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 else() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 set(FirstRun ON) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 DownloadPackage(${DCMTK_MD5} ${DCMTK_URL} "${DCMTK_SOURCES_DIR}") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 if (FirstRun) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 # Apply the patches |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 execute_process( |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i |
5488
5bd262ce16b3
fix dcmtk 3.6.8 patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5487
diff
changeset
|
58 ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-3.6.8.patch |
5487
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 RESULT_VARIABLE Failure |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 ) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 if (Failure) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 message(FATAL_ERROR "Error while patching a file") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 if (MSVC) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 # Older versions of Microsoft Visual Studio (notably MSVC2008) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 # don't like void usage of function arguments in C source files, |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 # in order to avoid a warning about unused arguments. This patch |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 # removes such usages that were not present in DCMTK <= 3.6.6. |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 execute_process( |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i |
5488
5bd262ce16b3
fix dcmtk 3.6.8 patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5487
diff
changeset
|
74 ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-3.6.8-visual-studio.patch |
5487
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 RESULT_VARIABLE Failure |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 ) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 if (Failure) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 message(FATAL_ERROR "Error while patching a file") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 configure_file( |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-dcdict_orthanc.cc |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdict_orthanc.cc |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 COPYONLY) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 else() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 message("The patches for DCMTK have already been applied") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 include_directories( |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 ${DCMTK_SOURCES_DIR}/dcmiod/include |
5489 | 95 ${DCMTK_SOURCES_DIR}/oficonv/include |
5487
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 ) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 # C_CHAR_UNSIGNED *must* be set before calling "GenerateDCMTKConfigure.cmake" |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 IF (CMAKE_CROSSCOMPILING) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 if (CMAKE_COMPILER_IS_GNUCXX AND |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 CMAKE_SYSTEM_NAME STREQUAL "Windows") # MinGW |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 elseif(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # WebAssembly or asm.js |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 # Check out "../WebAssembly/ArithmeticTests/" to regenerate the |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 # "arith.h" file |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 configure_file( |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 ${CMAKE_CURRENT_LIST_DIR}/WebAssembly/arith.h |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/arith.h |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
112 COPYONLY) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 UNSET(C_CHAR_UNSIGNED CACHE) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 SET(C_CHAR_UNSIGNED 0 CACHE INTERNAL "") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 else() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 message(FATAL_ERROR "Support your platform here") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 ENDIF() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 SET(DCMTK_ENABLE_CHARSET_CONVERSION "iconv" CACHE STRING "") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 SET(HAVE_SYS_GETTID 0 CACHE INTERNAL "") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR}) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # WebAssembly or |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 # asm.js The macros below are not properly discovered by DCMTK |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 # when using WebAssembly. Check out "../WebAssembly/arith.h" for |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 # how we produced these values. This step MUST be after |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 # "GenerateDCMTKConfigure" and before the generation of |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 # "osconfig.h". |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 UNSET(SIZEOF_VOID_P CACHE) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 UNSET(SIZEOF_CHAR CACHE) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 UNSET(SIZEOF_DOUBLE CACHE) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 UNSET(SIZEOF_FLOAT CACHE) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 UNSET(SIZEOF_INT CACHE) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 UNSET(SIZEOF_LONG CACHE) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 UNSET(SIZEOF_SHORT CACHE) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 UNSET(SIZEOF_VOID_P CACHE) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
148 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 SET(SIZEOF_CHAR 1 CACHE INTERNAL "") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 SET(SIZEOF_DOUBLE 8 CACHE INTERNAL "") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 SET(SIZEOF_FLOAT 4 CACHE INTERNAL "") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 SET(SIZEOF_INT 4 CACHE INTERNAL "") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 SET(SIZEOF_LONG 4 CACHE INTERNAL "") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 SET(SIZEOF_SHORT 2 CACHE INTERNAL "") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
160 set(DCMTK_PACKAGE_VERSION_SUFFIX "") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 set(DCMTK_PACKAGE_VERSION_NUMBER ${DCMTK_VERSION_NUMBER}) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
164 # For the dcmtls module, necessary since DCMTK 3.6.7 (cf. file |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
165 # "dcmtls/libsrc/tlslayer.cc"). This must be done before the |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
166 # invokation of "configure_file()"! |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
167 if (STATIC_BUILD OR NOT USE_SYSTEM_OPENSSL) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 # The "CHECK_FUNCTIONWITHHEADER_EXISTS()" provided by DCMTK only |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
169 # works with the system-wide version of OpenSSL. If statically |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
170 # linking against OpenSSL, we manually provide information about |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 # OpenSSL 3.0.x |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 set(HAVE_OPENSSL_PROTOTYPE_DH_BITS 1) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
173 set(HAVE_OPENSSL_PROTOTYPE_EVP_PKEY_BASE_ID 1) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
174 set(HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET0_PARAM 1) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 set(HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET_CERT_STORE 1) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
176 set(HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET_CIPHERS 1) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
177 set(HAVE_OPENSSL_PROTOTYPE_X509_GET_SIGNATURE_NID 1) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 set(HAVE_OPENSSL_PROTOTYPE_X509_STORE_GET0_PARAM 1) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
179 else() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
180 CHECK_FUNCTIONWITHHEADER_EXISTS("DH_bits" "openssl/dh.h" HAVE_OPENSSL_PROTOTYPE_DH_BITS) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
181 CHECK_FUNCTIONWITHHEADER_EXISTS("EVP_PKEY_base_id" "openssl/evp.h" HAVE_OPENSSL_PROTOTYPE_EVP_PKEY_BASE_ID) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
182 CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_get0_param" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET0_PARAM) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
183 CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_get_cert_store" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET_CERT_STORE) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
184 CHECK_FUNCTIONWITHHEADER_EXISTS("SSL_CTX_get_ciphers" "openssl/ssl.h" HAVE_OPENSSL_PROTOTYPE_SSL_CTX_GET_CIPHERS) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 CHECK_FUNCTIONWITHHEADER_EXISTS("X509_STORE_get0_param" "openssl/x509.h" HAVE_OPENSSL_PROTOTYPE_X509_STORE_GET0_PARAM) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 CHECK_FUNCTIONWITHHEADER_EXISTS("X509_get_signature_nid" "openssl/x509.h" HAVE_OPENSSL_PROTOTYPE_X509_GET_SIGNATURE_NID) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
187 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
188 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 |
5490
2742be05c0bc
setting DCMTK_ENABLE_CHARSET_CONVERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5489
diff
changeset
|
190 # "DCMTK_ENABLE_CHARSET_CONVERSION" is defined by "osconfig.h.in" |
5491 | 191 if (NOT DEFINED BOOST_LOCALE_BACKEND OR # This is the case if locale support is disabled (e.g. in Stone) |
192 BOOST_LOCALE_BACKEND STREQUAL "gcc") | |
193 set(DCMTK_ENABLE_CHARSET_CONVERSION "DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV" CACHE STRING "" FORCE) | |
5490
2742be05c0bc
setting DCMTK_ENABLE_CHARSET_CONVERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5489
diff
changeset
|
194 elseif (BOOST_LOCALE_BACKEND STREQUAL "libiconv") |
5491 | 195 set(DCMTK_ENABLE_CHARSET_CONVERSION "DCMTK_CHARSET_CONVERSION_ICONV" CACHE STRING "" FORCE) |
5490
2742be05c0bc
setting DCMTK_ENABLE_CHARSET_CONVERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5489
diff
changeset
|
196 elseif (BOOST_LOCALE_BACKEND STREQUAL "icu") |
5491 | 197 set(DCMTK_ENABLE_CHARSET_CONVERSION "DCMTK_CHARSET_CONVERSION_ICU" CACHE STRING "" FORCE) |
5490
2742be05c0bc
setting DCMTK_ENABLE_CHARSET_CONVERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5489
diff
changeset
|
198 else() |
2742be05c0bc
setting DCMTK_ENABLE_CHARSET_CONVERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5489
diff
changeset
|
199 message(FATAL_ERROR "Invalid value for BOOST_LOCALE_BACKEND: ${BOOST_LOCALE_BACKEND}") |
2742be05c0bc
setting DCMTK_ENABLE_CHARSET_CONVERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5489
diff
changeset
|
200 endif() |
2742be05c0bc
setting DCMTK_ENABLE_CHARSET_CONVERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5489
diff
changeset
|
201 |
5487
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
202 CONFIGURE_FILE( |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
203 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
204 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
205 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
206 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
207 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
208 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
209 link_libraries(netapi32) # For NetWkstaUserGetInfo@12 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
210 link_libraries(iphlpapi) # For GetAdaptersInfo@8 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
211 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
212 # Configure Wine if cross-compiling for Windows |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
213 if (CMAKE_COMPILER_IS_GNUCXX) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
214 include(${DCMTK_SOURCES_DIR}/CMake/dcmtkUseWine.cmake) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
215 FIND_PROGRAM(WINE_WINE_PROGRAM wine) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
216 FIND_PROGRAM(WINE_WINEPATH_PROGRAM winepath) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
217 list(APPEND DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=-static") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
218 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
219 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
220 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
221 # This step must be after the generation of "osconfig.h" |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
222 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
223 INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
224 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
225 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
226 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
227 # Source for the logging facility of DCMTK |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
228 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
229 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
230 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
231 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
232 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
233 ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" OR |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
234 ${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
235 list(REMOVE_ITEM DCMTK_SOURCES |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
236 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
237 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
238 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
239 ) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
240 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
241 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
242 list(REMOVE_ITEM DCMTK_SOURCES |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
243 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
244 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
245 ) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
246 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
247 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
248 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
249 # Starting with DCMTK 3.6.2, the Nagle algorithm is not disabled by |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
250 # default since this does not seem to be appropriate (anymore) for |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
251 # most modern operating systems. In order to change this default, the |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
252 # environment variable NO_TCPDELAY can be set to "1" (see envvars.txt |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
253 # for details). Alternatively, the macro DISABLE_NAGLE_ALGORITHM can |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
254 # be defined to change this setting at compilation time (see |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
255 # macros.txt for details). |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
256 # https://forum.dcmtk.org/viewtopic.php?t=4632 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
257 add_definitions( |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
258 -DDISABLE_NAGLE_ALGORITHM=1 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
259 ) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
260 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
261 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
262 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
263 # For compatibility with Windows XP, avoid using fiber-local-storage |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
264 # in log4cplus, but use thread-local-storage instead. Otherwise, |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
265 # Windows XP complains about missing "FlsGetValue()" in KERNEL32.dll |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
266 add_definitions( |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
267 -DDCMTK_LOG4CPLUS_AVOID_WIN32_FLS |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
268 ) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
269 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
270 if (CMAKE_COMPILER_IS_GNUCXX OR # MinGW |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
271 "${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") # MSVC for 32bit (*) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
272 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
273 # (*) With multithreaded logging enabled, Visual Studio 2008 fails |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
274 # with error: ".\dcmtk-3.6.7\oflog\libsrc\globinit.cc(422) : error |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
275 # C2664: 'dcmtk::log4cplus::thread::impl::tls_init' : cannot |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
276 # convert parameter 1 from 'void (__stdcall *)(void *)' to |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
277 # 'dcmtk::log4cplus::thread::impl::tls_init_cleanup_func_type'" |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
278 # None of the functions with this name in scope match the target type |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
279 |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
280 add_definitions( |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
281 -DDCMTK_LOG4CPLUS_SINGLE_THREADED |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
282 ) |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
283 endif() |
33f8e180edcf
upgraded static build to dcmtk 3.6.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
284 endif() |