Mercurial > hg > orthanc
annotate Resources/CMake/OpenSslConfiguration.cmake @ 1857:4f2386d0f326 dcmtk-3.6.1
integration mainline->dcmtk-3.6.1
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 02 Dec 2015 09:52:56 +0100 |
parents | d2bccd57795e |
children | d9e33b165112 |
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) |
1540 | 7 SET(OPENSSL_URL "www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/openssl-1.0.2d.zip") |
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 | |
29 -DOPENSSL_NO_ECDH | |
30 -DOPENSSL_NO_ECDSA | |
31 -DOPENSSL_NO_EC_NISTP_64_GCC_128 | |
32 -DOPENSSL_NO_GMP | |
33 -DOPENSSL_NO_GOST | |
34 -DOPENSSL_NO_HW | |
35 -DOPENSSL_NO_JPAKE | |
36 -DOPENSSL_NO_IDEA | |
37 -DOPENSSL_NO_KRB5 | |
38 -DOPENSSL_NO_MD2 | |
39 -DOPENSSL_NO_MDC2 | |
40 -DOPENSSL_NO_MD4 | |
41 -DOPENSSL_NO_RC2 | |
42 -DOPENSSL_NO_RC4 | |
43 -DOPENSSL_NO_RC5 | |
44 -DOPENSSL_NO_RFC3779 | |
45 -DOPENSSL_NO_SCTP | |
46 -DOPENSSL_NO_STORE | |
47 -DOPENSSL_NO_SEED | |
48 -DOPENSSL_NO_WHIRLPOOL | |
49 -DOPENSSL_NO_RIPEMD | |
50 ) | |
51 | |
52 include_directories( | |
53 ${OPENSSL_SOURCES_DIR} | |
54 ${OPENSSL_SOURCES_DIR}/crypto | |
55 ${OPENSSL_SOURCES_DIR}/crypto/asn1 | |
56 ${OPENSSL_SOURCES_DIR}/crypto/modes | |
57 ${OPENSSL_SOURCES_DIR}/crypto/evp | |
58 ${OPENSSL_SOURCES_DIR}/include | |
59 ) | |
60 | |
61 set(OPENSSL_SOURCES_SUBDIRS | |
62 ${OPENSSL_SOURCES_DIR}/crypto | |
63 ${OPENSSL_SOURCES_DIR}/crypto/aes | |
64 ${OPENSSL_SOURCES_DIR}/crypto/asn1 | |
65 ${OPENSSL_SOURCES_DIR}/crypto/bio | |
66 ${OPENSSL_SOURCES_DIR}/crypto/bn | |
67 ${OPENSSL_SOURCES_DIR}/crypto/buffer | |
68 ${OPENSSL_SOURCES_DIR}/crypto/cmac | |
69 ${OPENSSL_SOURCES_DIR}/crypto/cms | |
70 ${OPENSSL_SOURCES_DIR}/crypto/comp | |
71 ${OPENSSL_SOURCES_DIR}/crypto/conf | |
72 ${OPENSSL_SOURCES_DIR}/crypto/des | |
73 ${OPENSSL_SOURCES_DIR}/crypto/dh | |
74 ${OPENSSL_SOURCES_DIR}/crypto/dsa | |
75 ${OPENSSL_SOURCES_DIR}/crypto/dso | |
76 ${OPENSSL_SOURCES_DIR}/crypto/engine | |
77 ${OPENSSL_SOURCES_DIR}/crypto/err | |
78 ${OPENSSL_SOURCES_DIR}/crypto/evp | |
79 ${OPENSSL_SOURCES_DIR}/crypto/hmac | |
80 ${OPENSSL_SOURCES_DIR}/crypto/lhash | |
81 ${OPENSSL_SOURCES_DIR}/crypto/md5 | |
82 ${OPENSSL_SOURCES_DIR}/crypto/modes | |
83 ${OPENSSL_SOURCES_DIR}/crypto/objects | |
84 ${OPENSSL_SOURCES_DIR}/crypto/ocsp | |
85 ${OPENSSL_SOURCES_DIR}/crypto/pem | |
86 ${OPENSSL_SOURCES_DIR}/crypto/pkcs12 | |
87 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7 | |
88 ${OPENSSL_SOURCES_DIR}/crypto/pqueue | |
89 ${OPENSSL_SOURCES_DIR}/crypto/rand | |
90 ${OPENSSL_SOURCES_DIR}/crypto/rsa | |
91 ${OPENSSL_SOURCES_DIR}/crypto/sha | |
92 ${OPENSSL_SOURCES_DIR}/crypto/srp | |
93 ${OPENSSL_SOURCES_DIR}/crypto/stack | |
94 ${OPENSSL_SOURCES_DIR}/crypto/ts | |
95 ${OPENSSL_SOURCES_DIR}/crypto/txt_db | |
96 ${OPENSSL_SOURCES_DIR}/crypto/ui | |
97 ${OPENSSL_SOURCES_DIR}/crypto/x509 | |
98 ${OPENSSL_SOURCES_DIR}/crypto/x509v3 | |
99 ${OPENSSL_SOURCES_DIR}/ssl | |
100 ) | |
101 | |
102 foreach(d ${OPENSSL_SOURCES_SUBDIRS}) | |
103 AUX_SOURCE_DIRECTORY(${d} OPENSSL_SOURCES) | |
104 endforeach() | |
105 | |
106 list(REMOVE_ITEM OPENSSL_SOURCES | |
107 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_unix.c | |
108 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_vms.c | |
109 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_win.c | |
110 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_win32.c | |
111 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_wince.c | |
112 ${OPENSSL_SOURCES_DIR}/crypto/armcap.c | |
113 ${OPENSSL_SOURCES_DIR}/crypto/bf/bfs.cpp | |
114 ${OPENSSL_SOURCES_DIR}/crypto/bio/bss_rtcp.c | |
115 ${OPENSSL_SOURCES_DIR}/crypto/bn/exp.c | |
116 ${OPENSSL_SOURCES_DIR}/crypto/conf/cnf_save.c | |
117 ${OPENSSL_SOURCES_DIR}/crypto/conf/test.c | |
118 ${OPENSSL_SOURCES_DIR}/crypto/des/des.c | |
119 ${OPENSSL_SOURCES_DIR}/crypto/des/des3s.cpp | |
120 ${OPENSSL_SOURCES_DIR}/crypto/des/des_opts.c | |
121 ${OPENSSL_SOURCES_DIR}/crypto/des/dess.cpp | |
122 ${OPENSSL_SOURCES_DIR}/crypto/des/read_pwd.c | |
123 ${OPENSSL_SOURCES_DIR}/crypto/des/speed.c | |
124 ${OPENSSL_SOURCES_DIR}/crypto/evp/e_dsa.c | |
125 ${OPENSSL_SOURCES_DIR}/crypto/evp/m_ripemd.c | |
126 ${OPENSSL_SOURCES_DIR}/crypto/lhash/lh_test.c | |
127 ${OPENSSL_SOURCES_DIR}/crypto/md5/md5s.cpp | |
128 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/bio_ber.c | |
129 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/pk7_enc.c | |
130 ${OPENSSL_SOURCES_DIR}/crypto/ppccap.c | |
131 ${OPENSSL_SOURCES_DIR}/crypto/rand/randtest.c | |
132 ${OPENSSL_SOURCES_DIR}/crypto/s390xcap.c | |
133 ${OPENSSL_SOURCES_DIR}/crypto/sparcv9cap.c | |
134 ${OPENSSL_SOURCES_DIR}/crypto/x509v3/tabtest.c | |
135 ${OPENSSL_SOURCES_DIR}/crypto/x509v3/v3conf.c | |
136 ${OPENSSL_SOURCES_DIR}/ssl/ssl_task.c | |
137 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_nyi.c | |
138 ${OPENSSL_SOURCES_DIR}/crypto/aes/aes_x86core.c | |
139 ${OPENSSL_SOURCES_DIR}/crypto/bio/bss_dgram.c | |
140 ${OPENSSL_SOURCES_DIR}/crypto/bn/bntest.c | |
141 ${OPENSSL_SOURCES_DIR}/crypto/bn/expspeed.c | |
142 ${OPENSSL_SOURCES_DIR}/crypto/bn/exptest.c | |
143 ${OPENSSL_SOURCES_DIR}/crypto/engine/enginetest.c | |
144 ${OPENSSL_SOURCES_DIR}/crypto/evp/evp_test.c | |
145 ${OPENSSL_SOURCES_DIR}/crypto/hmac/hmactest.c | |
146 ${OPENSSL_SOURCES_DIR}/crypto/md5/md5.c | |
147 ${OPENSSL_SOURCES_DIR}/crypto/md5/md5test.c | |
148 ${OPENSSL_SOURCES_DIR}/crypto/o_dir_test.c | |
149 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/dec.c | |
150 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/enc.c | |
151 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/sign.c | |
152 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/verify.c | |
153 ${OPENSSL_SOURCES_DIR}/crypto/rsa/rsa_test.c | |
154 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha.c | |
155 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha1.c | |
156 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha1t.c | |
157 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha1test.c | |
158 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha256t.c | |
159 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha512t.c | |
160 ${OPENSSL_SOURCES_DIR}/crypto/sha/shatest.c | |
161 ${OPENSSL_SOURCES_DIR}/crypto/srp/srptest.c | |
162 | |
163 ${OPENSSL_SOURCES_DIR}/crypto/bn/divtest.c | |
164 ${OPENSSL_SOURCES_DIR}/crypto/bn/bnspeed.c | |
165 ${OPENSSL_SOURCES_DIR}/crypto/des/destest.c | |
166 ${OPENSSL_SOURCES_DIR}/crypto/dh/p192.c | |
167 ${OPENSSL_SOURCES_DIR}/crypto/dh/p512.c | |
168 ${OPENSSL_SOURCES_DIR}/crypto/dh/p1024.c | |
169 ${OPENSSL_SOURCES_DIR}/crypto/des/rpw.c | |
170 ${OPENSSL_SOURCES_DIR}/ssl/ssltest.c | |
171 ${OPENSSL_SOURCES_DIR}/crypto/dsa/dsagen.c | |
172 ${OPENSSL_SOURCES_DIR}/crypto/dsa/dsatest.c | |
173 ${OPENSSL_SOURCES_DIR}/crypto/dh/dhtest.c | |
174 ${OPENSSL_SOURCES_DIR}/crypto/pqueue/pq_test.c | |
175 ${OPENSSL_SOURCES_DIR}/crypto/des/ncbc_enc.c | |
176 ) | |
177 | |
178 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") | |
179 set_source_files_properties( | |
180 ${OPENSSL_SOURCES} | |
181 PROPERTIES COMPILE_DEFINITIONS | |
182 "OPENSSL_SYSNAME_WIN32;SO_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN") | |
183 | |
184 elseif ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | |
185 execute_process( | |
1542 | 186 COMMAND ${PATCH_EXECUTABLE} -N ui_openssl.c -i ${ORTHANC_ROOT}/Resources/Patches/openssl-lsb.diff |
735 | 187 WORKING_DIRECTORY ${OPENSSL_SOURCES_DIR}/crypto/ui |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
188 RESULT_VARIABLE Failure |
735 | 189 ) |
190 | |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
191 if (Failure AND FirstRun) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
192 message(FATAL_ERROR "Error while patching a file") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1530
diff
changeset
|
193 endif() |
735 | 194 endif() |
195 | |
196 else() | |
197 include(FindOpenSSL) | |
198 | |
199 if (NOT ${OPENSSL_FOUND}) | |
200 message(FATAL_ERROR "Unable to find OpenSSL") | |
201 endif() | |
202 | |
203 include_directories(${OPENSSL_INCLUDE_DIR}) | |
204 link_libraries(${OPENSSL_LIBRARIES}) | |
205 endif() |