Mercurial > hg > orthanc
annotate Resources/CMake/OpenSslConfiguration.cmake @ 29:042ac60f5bf9
simplified build of curl
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 29 Aug 2012 15:27:13 +0200 |
parents | ef264c1e9ee5 |
children | e9e3c9e6a555 |
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_nyi.c | |
110 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_unix.c | |
111 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_vms.c | |
112 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_win.c | |
113 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_win32.c | |
114 ${OPENSSL_SOURCES_DIR}/crypto/LPdir_wince.c | |
115 ${OPENSSL_SOURCES_DIR}/crypto/armcap.c | |
116 ${OPENSSL_SOURCES_DIR}/crypto/bf/bfs.cpp | |
117 ${OPENSSL_SOURCES_DIR}/crypto/bio/bss_rtcp.c | |
118 ${OPENSSL_SOURCES_DIR}/crypto/bn/exp.c | |
119 ${OPENSSL_SOURCES_DIR}/crypto/conf/cnf_save.c | |
120 ${OPENSSL_SOURCES_DIR}/crypto/conf/test.c | |
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 | |
28 | 138 ${OPENSSL_SOURCES_DIR}/crypto/des/des.c |
26 | 139 ${OPENSSL_SOURCES_DIR}/ssl/ssl_task.c |
140 ) | |
141 | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
28
diff
changeset
|
142 #if (${MSVC}) |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
28
diff
changeset
|
143 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
28 | 144 set_source_files_properties( |
145 ${OPENSSL_SOURCES} | |
146 PROPERTIES COMPILE_DEFINITIONS | |
147 "OPENSSL_SYSNAME_WIN32;SO_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN") | |
148 endif() | |
149 | |
26 | 150 add_library(OpenSSL STATIC ${OPENSSL_SOURCES}) |
151 link_libraries(OpenSSL) | |
152 | |
153 else() | |
154 include(FindOpenSSL) | |
155 | |
156 if (NOT ${OPENSSL_FOUND}) | |
157 message(FATAL_ERROR "Unable to find OpenSSL") | |
158 endif() | |
159 | |
160 include_directories(${OPENSSL_INCLUDE_DIR}) | |
161 link_libraries(${OPENSSL_LIBRARIES}) | |
162 endif() |