2013-10-15 19:17:36 +04:00
|
|
|
#.rst:
|
|
|
|
# FindOpenSSL
|
|
|
|
# -----------
|
|
|
|
#
|
|
|
|
# Try to find the OpenSSL encryption library
|
|
|
|
#
|
2008-07-22 21:35:07 +04:00
|
|
|
# Once done this will define
|
|
|
|
#
|
2013-10-15 19:17:36 +04:00
|
|
|
# ::
|
|
|
|
#
|
|
|
|
# OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
|
|
|
|
#
|
|
|
|
#
|
2010-06-15 12:33:58 +04:00
|
|
|
#
|
|
|
|
# Read-Only variables:
|
2013-10-15 19:17:36 +04:00
|
|
|
#
|
|
|
|
# ::
|
|
|
|
#
|
2014-11-28 17:21:53 +03:00
|
|
|
# OPENSSL_FOUND - System has the OpenSSL library
|
|
|
|
# OPENSSL_INCLUDE_DIR - The OpenSSL include directory
|
|
|
|
# OPENSSL_CRYPTO_LIBRARY - The OpenSSL crypto library
|
|
|
|
# OPENSSL_SSL_LIBRARY - The OpenSSL SSL library
|
|
|
|
# OPENSSL_LIBRARIES - All OpenSSL libraries
|
|
|
|
# OPENSSL_VERSION - This is set to $major.$minor.$revision$patch (eg. 0.9.8s)
|
2008-07-22 21:35:07 +04:00
|
|
|
|
2009-09-28 19:45:50 +04:00
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2006-2009 Kitware, Inc.
|
|
|
|
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
|
2011-03-28 19:52:44 +04:00
|
|
|
# Copyright 2009-2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
2008-07-22 21:35:07 +04:00
|
|
|
#
|
2009-09-28 19:45:50 +04:00
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 04:48:47 +04:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 19:45:50 +04:00
|
|
|
# License text for the above reference.)
|
2008-07-22 21:35:07 +04:00
|
|
|
|
2011-03-28 20:31:16 +04:00
|
|
|
if (UNIX)
|
2012-01-23 22:03:54 +04:00
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
pkg_check_modules(_OPENSSL QUIET openssl)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2011-03-28 20:31:16 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (WIN32)
|
2012-07-29 19:02:00 +04:00
|
|
|
# http://www.slproweb.com/products/Win32OpenSSL.html
|
2012-08-13 21:47:32 +04:00
|
|
|
set(_OPENSSL_ROOT_HINTS
|
2012-07-29 19:02:00 +04:00
|
|
|
${OPENSSL_ROOT_DIR}
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
|
|
|
|
ENV OPENSSL_ROOT_DIR
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
|
|
|
|
set(_OPENSSL_ROOT_PATHS
|
2012-07-29 19:02:00 +04:00
|
|
|
"${_programfiles}/OpenSSL"
|
|
|
|
"${_programfiles}/OpenSSL-Win32"
|
|
|
|
"${_programfiles}/OpenSSL-Win64"
|
|
|
|
"C:/OpenSSL/"
|
|
|
|
"C:/OpenSSL-Win32/"
|
|
|
|
"C:/OpenSSL-Win64/"
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
unset(_programfiles)
|
|
|
|
else ()
|
|
|
|
set(_OPENSSL_ROOT_HINTS
|
2012-07-29 19:02:00 +04:00
|
|
|
${OPENSSL_ROOT_DIR}
|
|
|
|
ENV OPENSSL_ROOT_DIR
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
endif ()
|
2010-06-15 12:33:58 +04:00
|
|
|
|
2014-02-05 04:13:59 +04:00
|
|
|
set(_OPENSSL_ROOT_HINTS_AND_PATHS
|
|
|
|
HINTS ${_OPENSSL_ROOT_HINTS}
|
|
|
|
PATHS ${_OPENSSL_ROOT_PATHS}
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_path(OPENSSL_INCLUDE_DIR
|
2011-03-28 20:31:16 +04:00
|
|
|
NAMES
|
|
|
|
openssl/ssl.h
|
2014-02-18 22:39:01 +04:00
|
|
|
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
2011-03-28 20:38:45 +04:00
|
|
|
HINTS
|
2011-03-28 20:31:16 +04:00
|
|
|
${_OPENSSL_INCLUDEDIR}
|
2011-03-28 20:38:45 +04:00
|
|
|
PATH_SUFFIXES
|
|
|
|
include
|
2009-10-30 18:35:15 +03:00
|
|
|
)
|
2008-07-22 21:35:07 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(WIN32 AND NOT CYGWIN)
|
|
|
|
if(MSVC)
|
2009-11-19 12:02:36 +03:00
|
|
|
# /MD and /MDd are the standard values - if someone wants to use
|
|
|
|
# others, the libnames have to change here too
|
|
|
|
# use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
|
|
|
|
# TODO: handle /MT and static lib
|
|
|
|
# In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix:
|
|
|
|
# * MD for dynamic-release
|
|
|
|
# * MDd for dynamic-debug
|
|
|
|
# * MT for static-release
|
|
|
|
# * MTd for static-debug
|
2008-07-22 21:35:07 +04:00
|
|
|
|
2009-11-19 12:02:36 +03:00
|
|
|
# Implementation details:
|
|
|
|
# We are using the libraries located in the VC subdir instead of the parent directory eventhough :
|
|
|
|
# libeay32MD.lib is identical to ../libeay32.lib, and
|
|
|
|
# ssleay32MD.lib is identical to ../ssleay32.lib
|
2015-07-30 17:09:34 +03:00
|
|
|
|
|
|
|
set(_OPENSSL_PATH_SUFFIXES
|
|
|
|
"lib"
|
|
|
|
"VC"
|
|
|
|
"lib/VC"
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(LIB_EAY_DEBUG
|
2011-03-28 20:38:45 +04:00
|
|
|
NAMES
|
|
|
|
libeay32MDd
|
2012-11-03 02:59:08 +04:00
|
|
|
libeay32d
|
2011-03-28 20:38:45 +04:00
|
|
|
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
|
|
PATH_SUFFIXES
|
2015-07-30 17:09:34 +03:00
|
|
|
${_OPENSSL_PATH_SUFFIXES}
|
2011-03-28 20:38:45 +04:00
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(LIB_EAY_RELEASE
|
2011-03-28 20:38:45 +04:00
|
|
|
NAMES
|
|
|
|
libeay32MD
|
|
|
|
libeay32
|
|
|
|
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
|
|
PATH_SUFFIXES
|
2015-07-30 17:09:34 +03:00
|
|
|
${_OPENSSL_PATH_SUFFIXES}
|
2011-03-28 20:38:45 +04:00
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(SSL_EAY_DEBUG
|
2011-03-28 20:38:45 +04:00
|
|
|
NAMES
|
|
|
|
ssleay32MDd
|
2012-11-03 02:59:08 +04:00
|
|
|
ssleay32d
|
2011-03-28 20:38:45 +04:00
|
|
|
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
|
|
PATH_SUFFIXES
|
2015-07-30 17:09:34 +03:00
|
|
|
${_OPENSSL_PATH_SUFFIXES}
|
2011-03-28 20:38:45 +04:00
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(SSL_EAY_RELEASE
|
2011-03-28 20:38:45 +04:00
|
|
|
NAMES
|
|
|
|
ssleay32MD
|
|
|
|
ssleay32
|
|
|
|
ssl
|
|
|
|
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
|
|
PATH_SUFFIXES
|
2015-07-30 17:09:34 +03:00
|
|
|
${_OPENSSL_PATH_SUFFIXES}
|
2011-03-28 20:38:45 +04:00
|
|
|
)
|
|
|
|
|
2012-11-02 23:41:37 +04:00
|
|
|
set(LIB_EAY_LIBRARY_DEBUG "${LIB_EAY_DEBUG}")
|
|
|
|
set(LIB_EAY_LIBRARY_RELEASE "${LIB_EAY_RELEASE}")
|
|
|
|
set(SSL_EAY_LIBRARY_DEBUG "${SSL_EAY_DEBUG}")
|
|
|
|
set(SSL_EAY_LIBRARY_RELEASE "${SSL_EAY_RELEASE}")
|
|
|
|
|
2012-07-23 23:00:40 +04:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
|
|
|
|
select_library_configurations(LIB_EAY)
|
|
|
|
select_library_configurations(SSL_EAY)
|
|
|
|
|
2013-09-17 10:10:08 +04:00
|
|
|
mark_as_advanced(LIB_EAY_LIBRARY_DEBUG LIB_EAY_LIBRARY_RELEASE
|
|
|
|
SSL_EAY_LIBRARY_DEBUG SSL_EAY_LIBRARY_RELEASE)
|
2015-07-30 17:09:34 +03:00
|
|
|
set(OPENSSL_SSL_LIBRARY ${SSL_EAY_LIBRARY} )
|
|
|
|
set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY_LIBRARY} )
|
|
|
|
set(OPENSSL_LIBRARIES ${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY} )
|
2012-08-13 21:47:32 +04:00
|
|
|
elseif(MINGW)
|
2013-05-04 16:53:26 +04:00
|
|
|
# same player, for MinGW
|
2012-08-13 21:47:32 +04:00
|
|
|
set(LIB_EAY_NAMES libeay32)
|
|
|
|
set(SSL_EAY_NAMES ssleay32)
|
2013-04-12 16:47:59 +04:00
|
|
|
if(CMAKE_CROSSCOMPILING)
|
2012-08-13 21:47:32 +04:00
|
|
|
list(APPEND LIB_EAY_NAMES crypto)
|
|
|
|
list(APPEND SSL_EAY_NAMES ssl)
|
|
|
|
endif()
|
|
|
|
find_library(LIB_EAY
|
2011-03-28 20:38:45 +04:00
|
|
|
NAMES
|
2012-07-23 22:34:48 +04:00
|
|
|
${LIB_EAY_NAMES}
|
2011-03-28 20:38:45 +04:00
|
|
|
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
"lib"
|
|
|
|
"lib/MinGW"
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(SSL_EAY
|
2011-03-28 20:38:45 +04:00
|
|
|
NAMES
|
2012-07-23 22:34:48 +04:00
|
|
|
${SSL_EAY_NAMES}
|
2011-03-28 20:38:45 +04:00
|
|
|
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
"lib"
|
|
|
|
"lib/MinGW"
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
mark_as_advanced(SSL_EAY LIB_EAY)
|
2015-07-30 17:09:34 +03:00
|
|
|
set(OPENSSL_SSL_LIBRARY ${SSL_EAY} )
|
|
|
|
set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY} )
|
|
|
|
set(OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
|
2012-07-23 22:34:48 +04:00
|
|
|
unset(LIB_EAY_NAMES)
|
|
|
|
unset(SSL_EAY_NAMES)
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2009-11-19 12:02:36 +03:00
|
|
|
# Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(LIB_EAY
|
2011-03-28 20:31:16 +04:00
|
|
|
NAMES
|
|
|
|
libeay32
|
2014-02-18 22:39:01 +04:00
|
|
|
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
2011-03-28 20:38:45 +04:00
|
|
|
HINTS
|
2011-03-28 20:31:16 +04:00
|
|
|
${_OPENSSL_LIBDIR}
|
2011-03-28 20:38:45 +04:00
|
|
|
PATH_SUFFIXES
|
|
|
|
lib
|
2011-03-28 20:31:16 +04:00
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(SSL_EAY
|
2011-03-28 20:31:16 +04:00
|
|
|
NAMES
|
|
|
|
ssleay32
|
2014-02-18 22:39:01 +04:00
|
|
|
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
2011-03-28 20:38:45 +04:00
|
|
|
HINTS
|
2011-03-28 20:31:16 +04:00
|
|
|
${_OPENSSL_LIBDIR}
|
2011-03-28 20:38:45 +04:00
|
|
|
PATH_SUFFIXES
|
|
|
|
lib
|
2011-03-28 20:31:16 +04:00
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
mark_as_advanced(SSL_EAY LIB_EAY)
|
2015-07-30 17:09:34 +03:00
|
|
|
set(OPENSSL_SSL_LIBRARY ${SSL_EAY} )
|
|
|
|
set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY} )
|
|
|
|
set(OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
else()
|
2008-07-22 21:35:07 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(OPENSSL_SSL_LIBRARY
|
2011-03-28 20:31:16 +04:00
|
|
|
NAMES
|
|
|
|
ssl
|
|
|
|
ssleay32
|
|
|
|
ssleay32MD
|
2014-02-18 22:39:01 +04:00
|
|
|
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
2011-03-28 20:38:45 +04:00
|
|
|
HINTS
|
2011-03-28 20:31:16 +04:00
|
|
|
${_OPENSSL_LIBDIR}
|
2011-03-28 20:38:45 +04:00
|
|
|
PATH_SUFFIXES
|
|
|
|
lib
|
2011-03-28 20:31:16 +04:00
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(OPENSSL_CRYPTO_LIBRARY
|
2011-03-28 20:31:16 +04:00
|
|
|
NAMES
|
|
|
|
crypto
|
2014-02-18 22:39:01 +04:00
|
|
|
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
2011-03-28 20:38:45 +04:00
|
|
|
HINTS
|
2011-03-28 20:31:16 +04:00
|
|
|
${_OPENSSL_LIBDIR}
|
2011-03-28 20:38:45 +04:00
|
|
|
PATH_SUFFIXES
|
|
|
|
lib
|
2011-03-28 20:31:16 +04:00
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
mark_as_advanced(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
|
2009-10-30 18:35:15 +03:00
|
|
|
|
2011-03-28 20:42:20 +04:00
|
|
|
# compat defines
|
2012-08-13 21:47:32 +04:00
|
|
|
set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
|
|
|
|
set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
|
2011-03-28 20:42:20 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
|
2008-07-22 21:35:07 +04:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2008-07-22 21:35:07 +04:00
|
|
|
|
2012-01-27 20:35:12 +04:00
|
|
|
function(from_hex HEX DEC)
|
|
|
|
string(TOUPPER "${HEX}" HEX)
|
|
|
|
set(_res 0)
|
|
|
|
string(LENGTH "${HEX}" _strlen)
|
|
|
|
|
|
|
|
while (_strlen GREATER 0)
|
|
|
|
math(EXPR _res "${_res} * 16")
|
|
|
|
string(SUBSTRING "${HEX}" 0 1 NIBBLE)
|
|
|
|
string(SUBSTRING "${HEX}" 1 -1 HEX)
|
|
|
|
if (NIBBLE STREQUAL "A")
|
|
|
|
math(EXPR _res "${_res} + 10")
|
|
|
|
elseif (NIBBLE STREQUAL "B")
|
|
|
|
math(EXPR _res "${_res} + 11")
|
|
|
|
elseif (NIBBLE STREQUAL "C")
|
|
|
|
math(EXPR _res "${_res} + 12")
|
|
|
|
elseif (NIBBLE STREQUAL "D")
|
|
|
|
math(EXPR _res "${_res} + 13")
|
|
|
|
elseif (NIBBLE STREQUAL "E")
|
|
|
|
math(EXPR _res "${_res} + 14")
|
|
|
|
elseif (NIBBLE STREQUAL "F")
|
|
|
|
math(EXPR _res "${_res} + 15")
|
|
|
|
else()
|
|
|
|
math(EXPR _res "${_res} + ${NIBBLE}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
string(LENGTH "${HEX}" _strlen)
|
|
|
|
endwhile()
|
|
|
|
|
|
|
|
set(${DEC} ${_res} PARENT_SCOPE)
|
2012-08-13 21:50:14 +04:00
|
|
|
endfunction()
|
2012-01-27 20:35:12 +04:00
|
|
|
|
2011-03-28 20:48:41 +04:00
|
|
|
if (OPENSSL_INCLUDE_DIR)
|
2015-01-10 01:40:20 +03:00
|
|
|
if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
|
2012-01-12 22:29:39 +04:00
|
|
|
file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
|
2015-01-28 00:53:54 +03:00
|
|
|
REGEX "^# *define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
|
2011-03-28 19:52:44 +04:00
|
|
|
|
2012-01-12 22:29:39 +04:00
|
|
|
# The version number is encoded as 0xMNNFFPPS: major minor fix patch status
|
|
|
|
# The status gives if this is a developer or prerelease and is ignored here.
|
|
|
|
# Major, minor, and fix directly translate into the version numbers shown in
|
|
|
|
# the string. The patch field translates to the single character suffix that
|
|
|
|
# indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
|
|
|
|
# on.
|
2011-03-28 19:52:44 +04:00
|
|
|
|
2012-01-17 22:02:31 +04:00
|
|
|
string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
|
2012-01-12 22:29:39 +04:00
|
|
|
"\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
|
|
|
|
list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
|
|
|
|
list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
|
2012-01-27 20:35:12 +04:00
|
|
|
from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
|
2012-01-12 22:29:39 +04:00
|
|
|
list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
|
2012-01-27 20:35:12 +04:00
|
|
|
from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
|
2012-01-12 22:29:39 +04:00
|
|
|
list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
|
2011-03-28 19:52:44 +04:00
|
|
|
|
2012-01-12 22:29:39 +04:00
|
|
|
if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
|
2012-01-27 20:35:12 +04:00
|
|
|
from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
|
2012-01-12 22:29:39 +04:00
|
|
|
# 96 is the ASCII code of 'a' minus 1
|
2012-01-27 20:35:12 +04:00
|
|
|
math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
|
|
|
|
unset(_tmp)
|
2012-01-12 22:29:39 +04:00
|
|
|
# Once anyone knows how OpenSSL would call the patch versions beyond 'z'
|
|
|
|
# this should be updated to handle that, too. This has not happened yet
|
|
|
|
# so it is simply ignored here for now.
|
|
|
|
string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2012-01-12 22:29:39 +04:00
|
|
|
|
|
|
|
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
|
|
|
endif ()
|
2008-07-22 21:35:07 +04:00
|
|
|
|
2011-03-28 20:48:41 +04:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
|
|
|
|
|
|
|
if (OPENSSL_VERSION)
|
|
|
|
find_package_handle_standard_args(OpenSSL
|
|
|
|
REQUIRED_VARS
|
|
|
|
OPENSSL_LIBRARIES
|
|
|
|
OPENSSL_INCLUDE_DIR
|
|
|
|
VERSION_VAR
|
|
|
|
OPENSSL_VERSION
|
|
|
|
FAIL_MESSAGE
|
|
|
|
"Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
|
|
|
|
)
|
2012-08-13 21:50:14 +04:00
|
|
|
else ()
|
2011-03-28 20:48:41 +04:00
|
|
|
find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
|
|
|
|
OPENSSL_LIBRARIES
|
|
|
|
OPENSSL_INCLUDE_DIR
|
|
|
|
)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif ()
|
2011-03-28 19:52:44 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
|