Mercurial > hg > orthanc
annotate Resources/CMake/OpenSslConfiguration.cmake @ 1211:88511c737760
integration db-changes->mainline
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 04 Nov 2014 13:57:11 +0100 |
parents | 3a26bc6e4867 |
children | bf6db7d2f8b1 6784a119484d |
rev | line source |
---|---|
735 | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_OPENSSL) |
748
de9763f63510
upgrade to openssl-1.0.1g because of heartbeat exploit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
735
diff
changeset
|
2 SET(OPENSSL_SOURCES_DIR ${CMAKE_BINARY_DIR}/openssl-1.0.1g) |
735 | 3 DownloadPackage( |
748
de9763f63510
upgrade to openssl-1.0.1g because of heartbeat exploit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
735
diff
changeset
|
4 "de62b43dfcd858e66a74bee1c834e959" |
de9763f63510
upgrade to openssl-1.0.1g because of heartbeat exploit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
735
diff
changeset
|
5 "www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/openssl-1.0.1g.tar.gz" |
735 | 6 "${OPENSSL_SOURCES_DIR}") |
7 | |
8 if (NOT EXISTS "${OPENSSL_SOURCES_DIR}/include/PATCHED") | |
9 if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") | |
10 message("Patching the symbolic links") | |
11 # Patch the symbolic links by copying the files | |
12 file(GLOB headers "${OPENSSL_SOURCES_DIR}/include/openssl/*.h") | |
13 foreach(header ${headers}) | |
14 message(${header}) | |
15 file(READ "${header}" symbolicLink) | |
16 message(${symbolicLink}) | |
17 configure_file("${OPENSSL_SOURCES_DIR}/include/openssl/${symbolicLink}" "${header}" COPYONLY) | |
18 endforeach() | |
19 file(WRITE "${OPENSSL_SOURCES_DIR}/include/PATCHED") | |
20 endif() | |
21 endif() | |
22 | |
23 add_definitions( | |
24 -DOPENSSL_THREADS | |
25 -DOPENSSL_IA32_SSE2 | |
26 -DOPENSSL_NO_ASM | |
27 -DOPENSSL_NO_DYNAMIC_ENGINE | |
28 -DNO_WINDOWS_BRAINDEATH | |
29 | |
30 -DOPENSSL_NO_BF | |
31 -DOPENSSL_NO_CAMELLIA | |
32 -DOPENSSL_NO_CAST | |
33 -DOPENSSL_NO_EC | |
34 -DOPENSSL_NO_ECDH | |
35 -DOPENSSL_NO_ECDSA | |
36 -DOPENSSL_NO_EC_NISTP_64_GCC_128 | |
37 -DOPENSSL_NO_GMP | |
38 -DOPENSSL_NO_GOST | |
39 -DOPENSSL_NO_HW | |
40 -DOPENSSL_NO_JPAKE | |
41 -DOPENSSL_NO_IDEA | |
42 -DOPENSSL_NO_KRB5 | |
43 -DOPENSSL_NO_MD2 | |
44 -DOPENSSL_NO_MDC2 | |
45 -DOPENSSL_NO_MD4 | |
46 -DOPENSSL_NO_RC2 | |
47 -DOPENSSL_NO_RC4 | |
48 -DOPENSSL_NO_RC5 | |
49 -DOPENSSL_NO_RFC3779 | |
50 -DOPENSSL_NO_SCTP | |
51 -DOPENSSL_NO_STORE | |
52 -DOPENSSL_NO_SEED | |
53 -DOPENSSL_NO_WHIRLPOOL | |
54 -DOPENSSL_NO_RIPEMD | |
55 ) | |
56 | |
57 include_directories( | |
58 ${OPENSSL_SOURCES_DIR} | |
59 ${OPENSSL_SOURCES_DIR}/crypto | |
60 ${OPENSSL_SOURCES_DIR}/crypto/asn1 | |
61 ${OPENSSL_SOURCES_DIR}/crypto/modes | |
62 ${OPENSSL_SOURCES_DIR}/crypto/evp | |
63 ${OPENSSL_SOURCES_DIR}/include | |
64 ) | |
65 | |
66 set(OPENSSL_SOURCES_SUBDIRS | |
67 ${OPENSSL_SOURCES_DIR}/crypto | |
68 ${OPENSSL_SOURCES_DIR}/crypto/aes | |
69 ${OPENSSL_SOURCES_DIR}/crypto/asn1 | |
70 ${OPENSSL_SOURCES_DIR}/crypto/bio | |
71 ${OPENSSL_SOURCES_DIR}/crypto/bn | |
72 ${OPENSSL_SOURCES_DIR}/crypto/buffer | |
73 ${OPENSSL_SOURCES_DIR}/crypto/cmac | |
74 ${OPENSSL_SOURCES_DIR}/crypto/cms | |
75 ${OPENSSL_SOURCES_DIR}/crypto/comp | |
76 ${OPENSSL_SOURCES_DIR}/crypto/conf | |
77 ${OPENSSL_SOURCES_DIR}/crypto/des | |
78 ${OPENSSL_SOURCES_DIR}/crypto/dh | |
79 ${OPENSSL_SOURCES_DIR}/crypto/dsa | |
80 ${OPENSSL_SOURCES_DIR}/crypto/dso | |
81 ${OPENSSL_SOURCES_DIR}/crypto/engine | |
82 ${OPENSSL_SOURCES_DIR}/crypto/err | |
83 ${OPENSSL_SOURCES_DIR}/crypto/evp | |
84 ${OPENSSL_SOURCES_DIR}/crypto/hmac | |
85 ${OPENSSL_SOURCES_DIR}/crypto/lhash | |
86 ${OPENSSL_SOURCES_DIR}/crypto/md5 | |
87 ${OPENSSL_SOURCES_DIR}/crypto/modes | |
88 ${OPENSSL_SOURCES_DIR}/crypto/objects | |
89 ${OPENSSL_SOURCES_DIR}/crypto/ocsp | |
90 ${OPENSSL_SOURCES_DIR}/crypto/pem | |
91 ${OPENSSL_SOURCES_DIR}/crypto/pkcs12 | |
92 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7 | |
93 ${OPENSSL_SOURCES_DIR}/crypto/pqueue | |
94 ${OPENSSL_SOURCES_DIR}/crypto/rand | |
95 ${OPENSSL_SOURCES_DIR}/crypto/rsa | |
96 ${OPENSSL_SOURCES_DIR}/crypto/sha | |
97 ${OPENSSL_SOURCES_DIR}/crypto/srp | |
98 ${OPENSSL_SOURCES_DIR}/crypto/stack | |
99 ${OPENSSL_SOURCES_DIR}/crypto/ts | |
100 ${OPENSSL_SOURCES_DIR}/crypto/txt_db | |
101 ${OPENSSL_SOURCES_DIR}/crypto/ui | |
102 ${OPENSSL_SOURCES_DIR}/crypto/x509 | |
103 ${OPENSSL_SOURCES_DIR}/crypto/x509v3 | |
104 ${OPENSSL_SOURCES_DIR}/ssl | |
105 ) | |
106 | |
107 foreach(d ${OPENSSL_SOURCES_SUBDIRS}) | |
108 AUX_SOURCE_DIRECTORY(${d} OPENSSL_SOURCES) | |
109 endforeach() | |
110 | |
111 list(REMOVE_ITEM OPENSSL_SOURCES | |
112 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_unix.c | |
113 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_vms.c | |
114 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_win.c | |
115 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_win32.c | |
116 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_wince.c | |
117 ${OPENSSL_SOURCES_DIR}/crypto/armcap.c | |
118 ${OPENSSL_SOURCES_DIR}/crypto/bf/bfs.cpp | |
119 ${OPENSSL_SOURCES_DIR}/crypto/bio/bss_rtcp.c | |
120 ${OPENSSL_SOURCES_DIR}/crypto/bn/exp.c | |
121 ${OPENSSL_SOURCES_DIR}/crypto/conf/cnf_save.c | |
122 ${OPENSSL_SOURCES_DIR}/crypto/conf/test.c | |
123 ${OPENSSL_SOURCES_DIR}/crypto/des/des.c | |
124 ${OPENSSL_SOURCES_DIR}/crypto/des/des3s.cpp | |
125 ${OPENSSL_SOURCES_DIR}/crypto/des/des_opts.c | |
126 ${OPENSSL_SOURCES_DIR}/crypto/des/dess.cpp | |
127 ${OPENSSL_SOURCES_DIR}/crypto/des/read_pwd.c | |
128 ${OPENSSL_SOURCES_DIR}/crypto/des/speed.c | |
129 ${OPENSSL_SOURCES_DIR}/crypto/evp/e_dsa.c | |
130 ${OPENSSL_SOURCES_DIR}/crypto/evp/m_ripemd.c | |
131 ${OPENSSL_SOURCES_DIR}/crypto/lhash/lh_test.c | |
132 ${OPENSSL_SOURCES_DIR}/crypto/md5/md5s.cpp | |
133 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/bio_ber.c | |
134 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/pk7_enc.c | |
135 ${OPENSSL_SOURCES_DIR}/crypto/ppccap.c | |
136 ${OPENSSL_SOURCES_DIR}/crypto/rand/randtest.c | |
137 ${OPENSSL_SOURCES_DIR}/crypto/s390xcap.c | |
138 ${OPENSSL_SOURCES_DIR}/crypto/sparcv9cap.c | |
139 ${OPENSSL_SOURCES_DIR}/crypto/x509v3/tabtest.c | |
140 ${OPENSSL_SOURCES_DIR}/crypto/x509v3/v3conf.c | |
141 ${OPENSSL_SOURCES_DIR}/ssl/ssl_task.c | |
142 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_nyi.c | |
143 ${OPENSSL_SOURCES_DIR}/crypto/aes/aes_x86core.c | |
144 ${OPENSSL_SOURCES_DIR}/crypto/bio/bss_dgram.c | |
145 ${OPENSSL_SOURCES_DIR}/crypto/bn/bntest.c | |
146 ${OPENSSL_SOURCES_DIR}/crypto/bn/expspeed.c | |
147 ${OPENSSL_SOURCES_DIR}/crypto/bn/exptest.c | |
148 ${OPENSSL_SOURCES_DIR}/crypto/engine/enginetest.c | |
149 ${OPENSSL_SOURCES_DIR}/crypto/evp/evp_test.c | |
150 ${OPENSSL_SOURCES_DIR}/crypto/hmac/hmactest.c | |
151 ${OPENSSL_SOURCES_DIR}/crypto/md5/md5.c | |
152 ${OPENSSL_SOURCES_DIR}/crypto/md5/md5test.c | |
153 ${OPENSSL_SOURCES_DIR}/crypto/o_dir_test.c | |
154 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/dec.c | |
155 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/enc.c | |
156 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/sign.c | |
157 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/verify.c | |
158 ${OPENSSL_SOURCES_DIR}/crypto/rsa/rsa_test.c | |
159 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha.c | |
160 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha1.c | |
161 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha1t.c | |
162 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha1test.c | |
163 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha256t.c | |
164 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha512t.c | |
165 ${OPENSSL_SOURCES_DIR}/crypto/sha/shatest.c | |
166 ${OPENSSL_SOURCES_DIR}/crypto/srp/srptest.c | |
167 | |
168 ${OPENSSL_SOURCES_DIR}/crypto/bn/divtest.c | |
169 ${OPENSSL_SOURCES_DIR}/crypto/bn/bnspeed.c | |
170 ${OPENSSL_SOURCES_DIR}/crypto/des/destest.c | |
171 ${OPENSSL_SOURCES_DIR}/crypto/dh/p192.c | |
172 ${OPENSSL_SOURCES_DIR}/crypto/dh/p512.c | |
173 ${OPENSSL_SOURCES_DIR}/crypto/dh/p1024.c | |
174 ${OPENSSL_SOURCES_DIR}/crypto/des/rpw.c | |
175 ${OPENSSL_SOURCES_DIR}/ssl/ssltest.c | |
176 ${OPENSSL_SOURCES_DIR}/crypto/dsa/dsagen.c | |
177 ${OPENSSL_SOURCES_DIR}/crypto/dsa/dsatest.c | |
178 ${OPENSSL_SOURCES_DIR}/crypto/dh/dhtest.c | |
179 ${OPENSSL_SOURCES_DIR}/crypto/pqueue/pq_test.c | |
180 ${OPENSSL_SOURCES_DIR}/crypto/des/ncbc_enc.c | |
181 ) | |
182 | |
183 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") | |
184 set_source_files_properties( | |
185 ${OPENSSL_SOURCES} | |
186 PROPERTIES COMPILE_DEFINITIONS | |
187 "OPENSSL_SYSNAME_WIN32;SO_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN") | |
188 | |
189 elseif ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | |
190 execute_process( | |
1057
3a26bc6e4867
more generic paths in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
748
diff
changeset
|
191 COMMAND patch ui_openssl.c ${ORTHANC_ROOT}/Resources/Patches/openssl-lsb.diff |
735 | 192 WORKING_DIRECTORY ${OPENSSL_SOURCES_DIR}/crypto/ui |
193 ) | |
194 | |
195 endif() | |
196 | |
197 #add_library(OpenSSL STATIC ${OPENSSL_SOURCES}) | |
198 #link_libraries(OpenSSL) | |
199 | |
200 else() | |
201 include(FindOpenSSL) | |
202 | |
203 if (NOT ${OPENSSL_FOUND}) | |
204 message(FATAL_ERROR "Unable to find OpenSSL") | |
205 endif() | |
206 | |
207 include_directories(${OPENSSL_INCLUDE_DIR}) | |
208 link_libraries(${OPENSSL_LIBRARIES}) | |
209 endif() |