diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-03-24 02:27:47 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-03-26 11:43:54 -0500 |
commit | 621d9e5c413e561293d7484b93882d985b3fe15f (patch) | |
tree | 638f3d75761c121d9a8fb50b52a12a6686c5ac5c /cmake/Modules/FindOpenSSL.cmake | |
parent | 40d3643b8d91886bf210aa27f711731c81a11e49 (diff) | |
download | pki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.gz pki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.xz pki-621d9e5c413e561293d7484b93882d985b3fe15f.zip |
Removed unnecessary pki folder.
Previously the source code was located inside a pki folder.
This folder was created during svn migration and is no longer
needed. This folder has now been removed and the contents have
been moved up one level.
Ticket #131
Diffstat (limited to 'cmake/Modules/FindOpenSSL.cmake')
-rw-r--r-- | cmake/Modules/FindOpenSSL.cmake | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/cmake/Modules/FindOpenSSL.cmake b/cmake/Modules/FindOpenSSL.cmake new file mode 100644 index 000000000..05126f1d2 --- /dev/null +++ b/cmake/Modules/FindOpenSSL.cmake @@ -0,0 +1,143 @@ +# - Try to find OpenSSL +# Once done this will define +# +# OPENSSL_FOUND - system has OpenSSL +# OPENSSL_INCLUDE_DIRS - the OpenSSL include directory +# OPENSSL_LIBRARIES - Link these to use OpenSSL +# OPENSSL_DEFINITIONS - Compiler switches required for using OpenSSL +# +# Copyright (c) 2009-2010 Andreas Schneider <mail@cynapses.org> +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +if (OPENSSL_LIBRARIES AND OPENSSL_INCLUDE_DIRS) + # in cache already + set(OPENSSL_FOUND TRUE) +else (OPENSSL_LIBRARIES AND OPENSSL_INCLUDE_DIRS) + if (WIN32) + set(_OPENSSL_DIR $ENV{PROGRAMFILES}/OpenSSL) + endif (WIN32) + + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + pkg_check_modules(_OPENSSL openssl) + endif (PKG_CONFIG_FOUND) + + find_path(OPENSSL_INCLUDE_DIR + NAMES + openssl/ssl.h + PATHS + ${_OPENSSL_DIR}/include + ${_OPENSSL_INCLUDEDIR} + /usr/include + /usr/local/include + /opt/local/include + /sw/include + /usr/lib/sfw/include + ) + + find_library(SSL_LIBRARY + NAMES + ssl + libssl + PATHS + ${_OPENSSL_DIR}/lib + ${_OPENSSL_LIBDIR} + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + /usr/sfw/lib/64 + /usr/sfw/lib + ) + + find_library(SSLEAY32_LIBRARY + NAMES + ssleay32 + PATHS + ${_OPENSSL_DIR}/lib + ${_OPENSSL_LIBDIR} + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + /usr/sfw/lib/64 + /usr/sfw/lib + ) + + find_library(SSLEAY32MD_LIBRARY + NAMES + ssleay32MD + PATHS + ${_OPENSSL_DIR}/lib + ${_OPENSSL_LIBDIR} + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + /usr/sfw/lib/64 + /usr/sfw/lib + ) + + find_library(CRYPTO_LIBRARY + NAMES + crypto + libcrypto + eay + eay32 + libeay + libeay32 + PATHS + ${_OPENSSL_DIR}/lib + ${_OPENSSL_LIBDIR} + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + /usr/sfw/lib/64 + /usr/sfw/lib + ) + + set(OPENSSL_INCLUDE_DIRS + ${OPENSSL_INCLUDE_DIR} + ) + + if (SSL_LIBRARY) + set(OPENSSL_LIBRARIES + ${OPENSSL_LIBRARIES} + ${SSL_LIBRARY} + ) + endif (SSL_LIBRARY) + + if (SSLEAY32_LIBRARY) + set(OPENSSL_LIBRARIES + ${OPENSSL_LIBRARIES} + ${SSLEAY32_LIBRARY} + ) + endif (SSLEAY32_LIBRARY) + + if (SSLEAY32MD_LIBRARY) + set(OPENSSL_LIBRARIES + ${OPENSSL_LIBRARIES} + ${SSLEAY32MD_LIBRARY} + ) + endif (SSLEAY32MD_LIBRARY) + + if (CRYPTO_LIBRARY) + set(OPENSSL_LIBRARIES + ${OPENSSL_LIBRARIES} + ${CRYPTO_LIBRARY} + ) + endif (CRYPTO_LIBRARY) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(OpenSSL DEFAULT_MSG OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIRS) + + # show the OPENSSL_INCLUDE_DIRS and OPENSSL_LIBRARIES variables only in the advanced view + mark_as_advanced(OPENSSL_INCLUDE_DIRS OPENSSL_LIBRARIES) + +endif (OPENSSL_LIBRARIES AND OPENSSL_INCLUDE_DIRS) |