Mercurial > hg > orthanc
annotate Resources/CMake/OpenSslConfiguration.cmake @ 2253:441352e7a9d1
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 25 Jan 2017 14:16:46 +0100 |
parents | ad72fbd700b7 |
children | 2aff870c2c58 |
rev | line source |
---|---|
735 | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_OPENSSL) |
1540 | 2 # WARNING - We had to repack the upstream ".tar.gz" file to a ZIP |
3 # file, as the upstream distribution ships symbolic links that are | |
4 # not always properly handled when uncompressing on Windows. | |
5 | |
1530
766a42aac55d
Upgrade to libcurl 1.0.2d for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1362
diff
changeset
|
6 SET(OPENSSL_SOURCES_DIR ${CMAKE_BINARY_DIR}/openssl-1.0.2d) |
2187
ad72fbd700b7
move of third party downloads to the main server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2113
diff
changeset
|
7 SET(OPENSSL_URL "http://www.orthanc-server.com/downloads/third-party/openssl-1.0.2d.zip") |
1540 | 8 SET(OPENSSL_MD5 "4b2ac15fc6db17f3dadc54482d3eee85") |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
9 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
10 if (IS_DIRECTORY "${OPENSSL_SOURCES_DIR}") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
11 set(FirstRun OFF) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
12 else() |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
13 set(FirstRun ON) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
14 endif() |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
15 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
16 DownloadPackage(${OPENSSL_MD5} ${OPENSSL_URL} "${OPENSSL_SOURCES_DIR}") |
735 | 17 |
18 add_definitions( | |
19 -DOPENSSL_THREADS | |
20 -DOPENSSL_IA32_SSE2 | |
21 -DOPENSSL_NO_ASM | |
22 -DOPENSSL_NO_DYNAMIC_ENGINE | |
23 -DNO_WINDOWS_BRAINDEATH | |
24 | |
25 -DOPENSSL_NO_BF | |
26 -DOPENSSL_NO_CAMELLIA | |
27 -DOPENSSL_NO_CAST | |
28 -DOPENSSL_NO_EC_NISTP_64_GCC_128 | |
29 -DOPENSSL_NO_GMP | |
30 -DOPENSSL_NO_GOST | |
31 -DOPENSSL_NO_HW | |
32 -DOPENSSL_NO_JPAKE | |
33 -DOPENSSL_NO_IDEA | |
34 -DOPENSSL_NO_KRB5 | |
35 -DOPENSSL_NO_MD2 | |
36 -DOPENSSL_NO_MDC2 | |
37 -DOPENSSL_NO_MD4 | |
38 -DOPENSSL_NO_RC2 | |
39 -DOPENSSL_NO_RC4 | |
40 -DOPENSSL_NO_RC5 | |
41 -DOPENSSL_NO_RFC3779 | |
42 -DOPENSSL_NO_SCTP | |
43 -DOPENSSL_NO_STORE | |
44 -DOPENSSL_NO_SEED | |
45 -DOPENSSL_NO_WHIRLPOOL | |
46 -DOPENSSL_NO_RIPEMD | |
47 ) | |
48 | |
49 include_directories( | |
50 ${OPENSSL_SOURCES_DIR} | |
51 ${OPENSSL_SOURCES_DIR}/crypto | |
52 ${OPENSSL_SOURCES_DIR}/crypto/asn1 | |
53 ${OPENSSL_SOURCES_DIR}/crypto/modes | |
54 ${OPENSSL_SOURCES_DIR}/crypto/evp | |
55 ${OPENSSL_SOURCES_DIR}/include | |
56 ) | |
57 | |
58 set(OPENSSL_SOURCES_SUBDIRS | |
59 ${OPENSSL_SOURCES_DIR}/crypto | |
60 ${OPENSSL_SOURCES_DIR}/crypto/aes | |
61 ${OPENSSL_SOURCES_DIR}/crypto/asn1 | |
62 ${OPENSSL_SOURCES_DIR}/crypto/bio | |
63 ${OPENSSL_SOURCES_DIR}/crypto/bn | |
64 ${OPENSSL_SOURCES_DIR}/crypto/buffer | |
65 ${OPENSSL_SOURCES_DIR}/crypto/cmac | |
66 ${OPENSSL_SOURCES_DIR}/crypto/cms | |
67 ${OPENSSL_SOURCES_DIR}/crypto/comp | |
68 ${OPENSSL_SOURCES_DIR}/crypto/conf | |
69 ${OPENSSL_SOURCES_DIR}/crypto/des | |
70 ${OPENSSL_SOURCES_DIR}/crypto/dh | |
71 ${OPENSSL_SOURCES_DIR}/crypto/dsa | |
72 ${OPENSSL_SOURCES_DIR}/crypto/dso | |
73 ${OPENSSL_SOURCES_DIR}/crypto/engine | |
74 ${OPENSSL_SOURCES_DIR}/crypto/err | |
75 ${OPENSSL_SOURCES_DIR}/crypto/evp | |
76 ${OPENSSL_SOURCES_DIR}/crypto/hmac | |
77 ${OPENSSL_SOURCES_DIR}/crypto/lhash | |
78 ${OPENSSL_SOURCES_DIR}/crypto/md5 | |
79 ${OPENSSL_SOURCES_DIR}/crypto/modes | |
80 ${OPENSSL_SOURCES_DIR}/crypto/objects | |
81 ${OPENSSL_SOURCES_DIR}/crypto/ocsp | |
82 ${OPENSSL_SOURCES_DIR}/crypto/pem | |
83 ${OPENSSL_SOURCES_DIR}/crypto/pkcs12 | |
84 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7 | |
85 ${OPENSSL_SOURCES_DIR}/crypto/pqueue | |
86 ${OPENSSL_SOURCES_DIR}/crypto/rand | |
87 ${OPENSSL_SOURCES_DIR}/crypto/rsa | |
88 ${OPENSSL_SOURCES_DIR}/crypto/sha | |
89 ${OPENSSL_SOURCES_DIR}/crypto/srp | |
90 ${OPENSSL_SOURCES_DIR}/crypto/stack | |
91 ${OPENSSL_SOURCES_DIR}/crypto/ts | |
92 ${OPENSSL_SOURCES_DIR}/crypto/txt_db | |
93 ${OPENSSL_SOURCES_DIR}/crypto/ui | |
94 ${OPENSSL_SOURCES_DIR}/crypto/x509 | |
95 ${OPENSSL_SOURCES_DIR}/crypto/x509v3 | |
96 ${OPENSSL_SOURCES_DIR}/ssl | |
97 ) | |
98 | |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
99 if (ENABLE_PKCS11) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
100 list(APPEND OPENSSL_SOURCES_SUBDIRS |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
101 # EC, ECDH and ECDSA are necessary for PKCS11 |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
102 ${OPENSSL_SOURCES_DIR}/crypto/ec |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
103 ${OPENSSL_SOURCES_DIR}/crypto/ecdh |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
104 ${OPENSSL_SOURCES_DIR}/crypto/ecdsa |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
105 ) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
106 else() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
107 add_definitions( |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
108 -DOPENSSL_NO_EC |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
109 -DOPENSSL_NO_ECDH |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
110 -DOPENSSL_NO_ECDSA |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
111 ) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
112 endif() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
113 |
735 | 114 foreach(d ${OPENSSL_SOURCES_SUBDIRS}) |
115 AUX_SOURCE_DIRECTORY(${d} OPENSSL_SOURCES) | |
116 endforeach() | |
117 | |
118 list(REMOVE_ITEM OPENSSL_SOURCES | |
119 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_unix.c | |
120 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_vms.c | |
121 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_win.c | |
122 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_win32.c | |
123 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_wince.c | |
124 ${OPENSSL_SOURCES_DIR}/crypto/armcap.c | |
125 ${OPENSSL_SOURCES_DIR}/crypto/bf/bfs.cpp | |
126 ${OPENSSL_SOURCES_DIR}/crypto/bio/bss_rtcp.c | |
127 ${OPENSSL_SOURCES_DIR}/crypto/bn/exp.c | |
128 ${OPENSSL_SOURCES_DIR}/crypto/conf/cnf_save.c | |
129 ${OPENSSL_SOURCES_DIR}/crypto/conf/test.c | |
130 ${OPENSSL_SOURCES_DIR}/crypto/des/des.c | |
131 ${OPENSSL_SOURCES_DIR}/crypto/des/des3s.cpp | |
132 ${OPENSSL_SOURCES_DIR}/crypto/des/des_opts.c | |
133 ${OPENSSL_SOURCES_DIR}/crypto/des/dess.cpp | |
134 ${OPENSSL_SOURCES_DIR}/crypto/des/read_pwd.c | |
135 ${OPENSSL_SOURCES_DIR}/crypto/des/speed.c | |
136 ${OPENSSL_SOURCES_DIR}/crypto/evp/e_dsa.c | |
137 ${OPENSSL_SOURCES_DIR}/crypto/evp/m_ripemd.c | |
138 ${OPENSSL_SOURCES_DIR}/crypto/lhash/lh_test.c | |
139 ${OPENSSL_SOURCES_DIR}/crypto/md5/md5s.cpp | |
140 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/bio_ber.c | |
141 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/pk7_enc.c | |
142 ${OPENSSL_SOURCES_DIR}/crypto/ppccap.c | |
143 ${OPENSSL_SOURCES_DIR}/crypto/rand/randtest.c | |
144 ${OPENSSL_SOURCES_DIR}/crypto/s390xcap.c | |
145 ${OPENSSL_SOURCES_DIR}/crypto/sparcv9cap.c | |
146 ${OPENSSL_SOURCES_DIR}/crypto/x509v3/tabtest.c | |
147 ${OPENSSL_SOURCES_DIR}/crypto/x509v3/v3conf.c | |
148 ${OPENSSL_SOURCES_DIR}/ssl/ssl_task.c | |
149 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_nyi.c | |
150 ${OPENSSL_SOURCES_DIR}/crypto/aes/aes_x86core.c | |
151 ${OPENSSL_SOURCES_DIR}/crypto/bio/bss_dgram.c | |
152 ${OPENSSL_SOURCES_DIR}/crypto/bn/bntest.c | |
153 ${OPENSSL_SOURCES_DIR}/crypto/bn/expspeed.c | |
154 ${OPENSSL_SOURCES_DIR}/crypto/bn/exptest.c | |
155 ${OPENSSL_SOURCES_DIR}/crypto/engine/enginetest.c | |
156 ${OPENSSL_SOURCES_DIR}/crypto/evp/evp_test.c | |
157 ${OPENSSL_SOURCES_DIR}/crypto/hmac/hmactest.c | |
158 ${OPENSSL_SOURCES_DIR}/crypto/md5/md5.c | |
159 ${OPENSSL_SOURCES_DIR}/crypto/md5/md5test.c | |
160 ${OPENSSL_SOURCES_DIR}/crypto/o_dir_test.c | |
161 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/dec.c | |
162 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/enc.c | |
163 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/sign.c | |
164 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/verify.c | |
165 ${OPENSSL_SOURCES_DIR}/crypto/rsa/rsa_test.c | |
166 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha.c | |
167 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha1.c | |
168 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha1t.c | |
169 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha1test.c | |
170 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha256t.c | |
171 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha512t.c | |
172 ${OPENSSL_SOURCES_DIR}/crypto/sha/shatest.c | |
173 ${OPENSSL_SOURCES_DIR}/crypto/srp/srptest.c | |
174 | |
175 ${OPENSSL_SOURCES_DIR}/crypto/bn/divtest.c | |
176 ${OPENSSL_SOURCES_DIR}/crypto/bn/bnspeed.c | |
177 ${OPENSSL_SOURCES_DIR}/crypto/des/destest.c | |
178 ${OPENSSL_SOURCES_DIR}/crypto/dh/p192.c | |
179 ${OPENSSL_SOURCES_DIR}/crypto/dh/p512.c | |
180 ${OPENSSL_SOURCES_DIR}/crypto/dh/p1024.c | |
181 ${OPENSSL_SOURCES_DIR}/crypto/des/rpw.c | |
182 ${OPENSSL_SOURCES_DIR}/ssl/ssltest.c | |
183 ${OPENSSL_SOURCES_DIR}/crypto/dsa/dsagen.c | |
184 ${OPENSSL_SOURCES_DIR}/crypto/dsa/dsatest.c | |
185 ${OPENSSL_SOURCES_DIR}/crypto/dh/dhtest.c | |
186 ${OPENSSL_SOURCES_DIR}/crypto/pqueue/pq_test.c | |
187 ${OPENSSL_SOURCES_DIR}/crypto/des/ncbc_enc.c | |
1919
d9e33b165112
more unneeded files for openssl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1542
diff
changeset
|
188 |
d9e33b165112
more unneeded files for openssl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1542
diff
changeset
|
189 ${OPENSSL_SOURCES_DIR}/crypto/evp/evp_extra_test.c |
d9e33b165112
more unneeded files for openssl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1542
diff
changeset
|
190 ${OPENSSL_SOURCES_DIR}/crypto/evp/verify_extra_test.c |
d9e33b165112
more unneeded files for openssl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1542
diff
changeset
|
191 ${OPENSSL_SOURCES_DIR}/crypto/x509/verify_extra_test.c |
d9e33b165112
more unneeded files for openssl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1542
diff
changeset
|
192 ${OPENSSL_SOURCES_DIR}/crypto/x509v3/v3prin.c |
d9e33b165112
more unneeded files for openssl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1542
diff
changeset
|
193 ${OPENSSL_SOURCES_DIR}/crypto/x509v3/v3nametest.c |
d9e33b165112
more unneeded files for openssl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1542
diff
changeset
|
194 ${OPENSSL_SOURCES_DIR}/crypto/constant_time_test.c |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
195 ${OPENSSL_SOURCES_DIR}/crypto/ec/ecp_nistz256_table.c |
2098 | 196 |
197 ${OPENSSL_SOURCES_DIR}/ssl/heartbeat_test.c | |
735 | 198 ) |
199 | |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1919
diff
changeset
|
200 |
735 | 201 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") |
202 set_source_files_properties( | |
203 ${OPENSSL_SOURCES} | |
204 PROPERTIES COMPILE_DEFINITIONS | |
205 "OPENSSL_SYSNAME_WIN32;SO_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN") | |
206 | |
207 elseif ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | |
208 execute_process( | |
1542 | 209 COMMAND ${PATCH_EXECUTABLE} -N ui_openssl.c -i ${ORTHANC_ROOT}/Resources/Patches/openssl-lsb.diff |
735 | 210 WORKING_DIRECTORY ${OPENSSL_SOURCES_DIR}/crypto/ui |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
211 RESULT_VARIABLE Failure |
735 | 212 ) |
213 | |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
214 if (Failure AND FirstRun) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
215 message(FATAL_ERROR "Error while patching a file") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
216 endif() |
735 | 217 endif() |
218 | |
2113
0108ac01fc8e
added source_group directives for MSVC
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2098
diff
changeset
|
219 source_group(ThirdParty\\OpenSSL REGULAR_EXPRESSION ${OPENSSL_SOURCES_DIR}/.*) |
0108ac01fc8e
added source_group directives for MSVC
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2098
diff
changeset
|
220 |
735 | 221 else() |
222 include(FindOpenSSL) | |
223 | |
224 if (NOT ${OPENSSL_FOUND}) | |
225 message(FATAL_ERROR "Unable to find OpenSSL") | |
226 endif() | |
227 | |
228 include_directories(${OPENSSL_INCLUDE_DIR}) | |
229 link_libraries(${OPENSSL_LIBRARIES}) | |
230 endif() |