blob: 01f7d20e5d2b3f24dc024af6a6b61baf140c1b6e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
#
# Find the OpenSSL client includes and library
#
# This module defines
# OPENSSL_INCLUDE_DIR, where to find openssl.h
# OPENSSL_LIBRARIES, the libraries to link against to connect to MySQL
# OPENSSL_FOUND, if false, you cannot build anything that requires MySQL.
# also defined, but not for general use are
# OPENSSL_LIBRARY, where to find the MySQL library.
set(OPENSSL_FOUND 0)
if( MSVC )
if(PLATFORM MATCHES X64)
set(TMP_OPENSSL_INCLUDE_DIR
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]/include"
)
set(TMP_OPENSSL_LIBRARIES
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]/lib"
)
else()
set(TMP_OPENSSL_INCLUDE_DIR
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/include"
)
set(TMP_OPENSSL_LIBRARIES
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]/lib"
)
endif()
endif()
find_path(OPENSSL_INCLUDE_DIR
NAMES
openssl/ssl.h
PATHS
${TMP_OPENSSL_INCLUDE_DIR}
/usr/include
/usr/include/openssl
/usr/local/include
/usr/local/include/openssl
/usr/local/openssl/include
DOC
"Specify the directory containing openssl.h."
)
find_library(OPENSSL_LIBRARIES
NAMES
ssleay32
ssl
PATHS
${TMP_OPENSSL_LIBRARIES}
/usr/lib
/usr/lib/ssl
/usr/local/lib
/usr/local/lib/ssl
/usr/local/ssl/lib
DOC "Specify the OpenSSL library here."
)
if( WIN32 )
find_library(OPENSSL_EXTRA_LIBRARIES
NAMES
libeay32
PATHS
${TMP_OPENSSL_LIBRARIES}
DOC
"if more libraries are necessary to link in a OpenSSL client, specify them here."
)
endif( WIN32 )
if( OPENSSL_LIBRARIES )
if( OPENSSL_INCLUDE_DIR )
set( OPENSSL_FOUND 1 )
message(STATUS "Found OpenSSL library: ${OPENSSL_LIBRARIES}")
message(STATUS "Found OpenSSL headers: ${OPENSSL_INCLUDE_DIR}")
else ( OPENSSL_INCLUDE_DIR )
message(FATAL_ERROR "Could not find OpenSSL headers! Please install the development-headers")
endif( OPENSSL_INCLUDE_DIR )
else( OPENSSL_LIBRARIES )
message(FATAL_ERROR "Could not find OpenSSL libraries! Please install the library before continuing")
endif( OPENSSL_LIBRARIES )
mark_as_advanced( OPENSSL_FOUND OPENSSL_LIBRARIES OPENSSL_EXTRA_LIBRARIES OPENSSL_INCLUDE_DIR )
|