Mercurial > hg > orthanc
annotate Resources/CMake/OpenSslConfiguration.cmake @ 272:337c506461d2
protection from rest api
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 07 Dec 2012 18:21:04 +0100 |
parents | e9e3c9e6a555 |
children | b45bc565d82a 0db2713b91d8 61ab5fa36754 |
rev | line source |
---|---|
26 | 1 if (${STATIC_BUILD}) |
2 SET(OPENSSL_SOURCES_DIR ${CMAKE_BINARY_DIR}/openssl-1.0.1c) | |
3 DownloadPackage("http://www.openssl.org/source/openssl-1.0.1c.tar.gz" "${OPENSSL_SOURCES_DIR}" "" "") | |
4 | |
27 | 5 if (NOT EXISTS "${OPENSSL_SOURCES_DIR}/include/PATCHED") |
6 if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
28
diff
changeset
|
7 message("Patching the symbolic links") |
27 | 8 # Patch the symbolic links by copying the files |
9 file(GLOB headers "${OPENSSL_SOURCES_DIR}/include/openssl/*.h") | |
10 foreach(header ${headers}) | |
11 message(${header}) | |
12 file(READ "${header}" symbolicLink) | |
13 message(${symbolicLink}) | |
14 configure_file("${OPENSSL_SOURCES_DIR}/include/openssl/${symbolicLink}" "${header}" COPYONLY) | |
15 endforeach() | |
16 file(WRITE "${OPENSSL_SOURCES_DIR}/include/PATCHED") | |
17 endif() | |
18 endif() | |
19 | |
26 | 20 add_definitions( |
21 -DOPENSSL_THREADS | |
22 -DOPENSSL_IA32_SSE2 | |
23 -DOPENSSL_NO_ASM | |
24 -DOPENSSL_NO_DYNAMIC_ENGINE | |
25 -DNO_WINDOWS_BRAINDEATH | |
26 | |
27 -DOPENSSL_NO_BF | |
28 -DOPENSSL_NO_CAMELLIA | |
29 -DOPENSSL_NO_CAST | |
30 -DOPENSSL_NO_EC | |
31 -DOPENSSL_NO_ECDH | |
32 -DOPENSSL_NO_ECDSA | |
33 -DOPENSSL_NO_EC_NISTP_64_GCC_128 | |
34 -DOPENSSL_NO_GMP | |
35 -DOPENSSL_NO_GOST | |
36 -DOPENSSL_NO_HW | |
37 -DOPENSSL_NO_JPAKE | |
38 -DOPENSSL_NO_IDEA | |
39 -DOPENSSL_NO_KRB5 | |
40 -DOPENSSL_NO_MD2 | |
41 -DOPENSSL_NO_MDC2 | |
42 -DOPENSSL_NO_MD4 | |
43 -DOPENSSL_NO_RC2 | |
44 -DOPENSSL_NO_RC4 | |
45 -DOPENSSL_NO_RC5 | |
46 -DOPENSSL_NO_RFC3779 | |
47 -DOPENSSL_NO_SCTP | |
48 -DOPENSSL_NO_STORE | |
49 -DOPENSSL_NO_SEED | |
50 -DOPENSSL_NO_WHIRLPOOL | |
51 -DOPENSSL_NO_RIPEMD | |
52 ) | |
53 | |
54 include_directories( | |
55 ${OPENSSL_SOURCES_DIR} | |
56 ${OPENSSL_SOURCES_DIR}/crypto | |
57 ${OPENSSL_SOURCES_DIR}/crypto/asn1 | |
58 ${OPENSSL_SOURCES_DIR}/crypto/modes | |
59 ${OPENSSL_SOURCES_DIR}/crypto/evp | |
60 ${OPENSSL_SOURCES_DIR}/include | |
61 ) | |
62 | |
63 set(OPENSSL_SOURCES_SUBDIRS | |
64 ${OPENSSL_SOURCES_DIR}/crypto | |
65 ${OPENSSL_SOURCES_DIR}/crypto/aes | |
66 ${OPENSSL_SOURCES_DIR}/crypto/asn1 | |
67 ${OPENSSL_SOURCES_DIR}/crypto/bio | |
68 ${OPENSSL_SOURCES_DIR}/crypto/bn | |
69 ${OPENSSL_SOURCES_DIR}/crypto/buffer | |
70 ${OPENSSL_SOURCES_DIR}/crypto/cmac | |
71 ${OPENSSL_SOURCES_DIR}/crypto/cms | |
72 ${OPENSSL_SOURCES_DIR}/crypto/comp | |
73 ${OPENSSL_SOURCES_DIR}/crypto/conf | |
74 ${OPENSSL_SOURCES_DIR}/crypto/des | |
75 ${OPENSSL_SOURCES_DIR}/crypto/dh | |
76 ${OPENSSL_SOURCES_DIR}/crypto/dsa | |
77 ${OPENSSL_SOURCES_DIR}/crypto/dso | |
78 ${OPENSSL_SOURCES_DIR}/crypto/engine | |
79 ${OPENSSL_SOURCES_DIR}/crypto/err | |
80 ${OPENSSL_SOURCES_DIR}/crypto/evp | |
81 ${OPENSSL_SOURCES_DIR}/crypto/hmac | |
82 ${OPENSSL_SOURCES_DIR}/crypto/lhash | |
83 ${OPENSSL_SOURCES_DIR}/crypto/md5 | |
84 ${OPENSSL_SOURCES_DIR}/crypto/modes | |
85 ${OPENSSL_SOURCES_DIR}/crypto/objects | |
86 ${OPENSSL_SOURCES_DIR}/crypto/ocsp | |
87 ${OPENSSL_SOURCES_DIR}/crypto/pem | |
88 ${OPENSSL_SOURCES_DIR}/crypto/pkcs12 | |
89 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7 | |
90 ${OPENSSL_SOURCES_DIR}/crypto/pqueue | |
91 ${OPENSSL_SOURCES_DIR}/crypto/rand | |
92 ${OPENSSL_SOURCES_DIR}/crypto/rsa | |
93 ${OPENSSL_SOURCES_DIR}/crypto/sha | |
94 ${OPENSSL_SOURCES_DIR}/crypto/srp | |
95 ${OPENSSL_SOURCES_DIR}/crypto/stack | |
96 ${OPENSSL_SOURCES_DIR}/crypto/ts | |
97 ${OPENSSL_SOURCES_DIR}/crypto/txt_db | |
98 ${OPENSSL_SOURCES_DIR}/crypto/ui | |
99 ${OPENSSL_SOURCES_DIR}/crypto/x509 | |
100 ${OPENSSL_SOURCES_DIR}/crypto/x509v3 | |
101 ${OPENSSL_SOURCES_DIR}/ssl | |
102 ) | |
103 | |
104 foreach(d ${OPENSSL_SOURCES_SUBDIRS}) | |
105 AUX_SOURCE_DIRECTORY(${d} OPENSSL_SOURCES) | |
106 endforeach() | |
107 | |
108 list(REMOVE_ITEM OPENSSL_SOURCES | |
109 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_unix.c | |
110 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_vms.c | |
111 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_win.c | |
112 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_win32.c | |
113 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_wince.c | |
114 ${OPENSSL_SOURCES_DIR}/crypto/armcap.c | |
115 ${OPENSSL_SOURCES_DIR}/crypto/bf/bfs.cpp | |
116 ${OPENSSL_SOURCES_DIR}/crypto/bio/bss_rtcp.c | |
117 ${OPENSSL_SOURCES_DIR}/crypto/bn/exp.c | |
118 ${OPENSSL_SOURCES_DIR}/crypto/conf/cnf_save.c | |
119 ${OPENSSL_SOURCES_DIR}/crypto/conf/test.c | |
65 | 120 ${OPENSSL_SOURCES_DIR}/crypto/des/des.c |
26 | 121 ${OPENSSL_SOURCES_DIR}/crypto/des/des3s.cpp |
122 ${OPENSSL_SOURCES_DIR}/crypto/des/des_opts.c | |
123 ${OPENSSL_SOURCES_DIR}/crypto/des/dess.cpp | |
124 ${OPENSSL_SOURCES_DIR}/crypto/des/read_pwd.c | |
125 ${OPENSSL_SOURCES_DIR}/crypto/des/speed.c | |
126 ${OPENSSL_SOURCES_DIR}/crypto/evp/e_dsa.c | |
127 ${OPENSSL_SOURCES_DIR}/crypto/evp/m_ripemd.c | |
128 ${OPENSSL_SOURCES_DIR}/crypto/lhash/lh_test.c | |
129 ${OPENSSL_SOURCES_DIR}/crypto/md5/md5s.cpp | |
130 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/bio_ber.c | |
131 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/pk7_enc.c | |
132 ${OPENSSL_SOURCES_DIR}/crypto/ppccap.c | |
27 | 133 ${OPENSSL_SOURCES_DIR}/crypto/rand/randtest.c |
26 | 134 ${OPENSSL_SOURCES_DIR}/crypto/s390xcap.c |
135 ${OPENSSL_SOURCES_DIR}/crypto/sparcv9cap.c | |
136 ${OPENSSL_SOURCES_DIR}/crypto/x509v3/tabtest.c | |
137 ${OPENSSL_SOURCES_DIR}/crypto/x509v3/v3conf.c | |
138 ${OPENSSL_SOURCES_DIR}/ssl/ssl_task.c | |
65 | 139 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_nyi.c |
140 ${OPENSSL_SOURCES_DIR}/crypto/aes/aes_x86core.c | |
141 ${OPENSSL_SOURCES_DIR}/crypto/bio/bss_dgram.c | |
142 ${OPENSSL_SOURCES_DIR}/crypto/bn/bntest.c | |
143 ${OPENSSL_SOURCES_DIR}/crypto/bn/expspeed.c | |
144 ${OPENSSL_SOURCES_DIR}/crypto/bn/exptest.c | |
145 ${OPENSSL_SOURCES_DIR}/crypto/engine/enginetest.c | |
146 ${OPENSSL_SOURCES_DIR}/crypto/evp/evp_test.c | |
147 ${OPENSSL_SOURCES_DIR}/crypto/hmac/hmactest.c | |
148 ${OPENSSL_SOURCES_DIR}/crypto/md5/md5.c | |
149 ${OPENSSL_SOURCES_DIR}/crypto/md5/md5test.c | |
150 ${OPENSSL_SOURCES_DIR}/crypto/o_dir_test.c | |
151 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/dec.c | |
152 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/enc.c | |
153 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/sign.c | |
154 ${OPENSSL_SOURCES_DIR}/crypto/pkcs7/verify.c | |
155 ${OPENSSL_SOURCES_DIR}/crypto/rsa/rsa_test.c | |
156 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha.c | |
157 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha1.c | |
158 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha1t.c | |
159 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha1test.c | |
160 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha256t.c | |
161 ${OPENSSL_SOURCES_DIR}/crypto/sha/sha512t.c | |
162 ${OPENSSL_SOURCES_DIR}/crypto/sha/shatest.c | |
163 ${OPENSSL_SOURCES_DIR}/crypto/srp/srptest.c | |
26 | 164 ) |
165 | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
28
diff
changeset
|
166 #if (${MSVC}) |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
28
diff
changeset
|
167 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
28 | 168 set_source_files_properties( |
169 ${OPENSSL_SOURCES} | |
170 PROPERTIES COMPILE_DEFINITIONS | |
171 "OPENSSL_SYSNAME_WIN32;SO_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN") | |
172 endif() | |
173 | |
26 | 174 add_library(OpenSSL STATIC ${OPENSSL_SOURCES}) |
175 link_libraries(OpenSSL) | |
176 | |
177 else() | |
178 include(FindOpenSSL) | |
179 | |
180 if (NOT ${OPENSSL_FOUND}) | |
181 message(FATAL_ERROR "Unable to find OpenSSL") | |
182 endif() | |
183 | |
184 include_directories(${OPENSSL_INCLUDE_DIR}) | |
185 link_libraries(${OPENSSL_LIBRARIES}) | |
186 endif() |