[Release] Webkit2-efl-123997_0.11.46
[framework/web/webkit-efl.git] / Source / cmake / FindOPENSSL.cmake
1 # - Try to find SSL, CRYPTO
2 # Once done, this will define
3 #
4 #  OPENSSL_FOUND
5 #  OPENSSL_INCLUDE_DIRS
6 #  OPENSSL_LIBRARIES
7
8 include(LibFindMacros)
9
10 # Use pkg-config to get hints about paths
11 libfind_pkg_check_modules(OPENSSL_PKGCONF openssl)
12
13 # Include dir
14 find_path(OPENSSL_INCLUDE_DIR
15   NAMES openssl/ssl.h
16   PATHS ${OPENSSL_PKGCONF_INCLUDE_DIRS}
17 )
18
19 # Finally the library itself
20 find_library(SSL_LIBRARY
21   NAMES ssl
22   PATHS ${OPENSSL_PKGCONF_LIBRARY_DIRS}
23 )
24
25 find_library(CRYPTO_LIBRARY
26   NAMES crypto
27   PATHS ${OPENSSL_PKGCONF_LIBRARY_DIRS}
28 )
29
30 SET(OPENSSL_LIBRARY
31   ${SSL_LIBRARY}
32   ${CRYPTO_LIBRARY}
33 )
34
35 # Set the include dir variables and the libraries and let libfind_process do the rest.
36 # NOTE: Singular variables for this library, plural for libraries this this lib depends on.
37 set(OPENSSL_PROCESS_INCLUDES OPENSSL_INCLUDE_DIR OPENSSL_INCLUDE_DIRS)
38 set(OPENSSL_PROCESS_LIBS OPENSSL_LIBRARY OPENSSL_LIBRARIES)
39 libfind_process(OPENSSL)
40