From e87cf19efdd5e3c8acf9b637f34b70182e3d2824 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 29 Sep 2019 09:51:35 +0200 Subject: build: Check OpenSSL version >= 1.1.0 The cryptographic functions require at least OpenSSL 1.1.0. The build will now check for this version and disable OpenSSL support when this requirement is not met. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/CMakeLists.txt | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/lib') diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 1a3c6ba3..31a7742b 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -86,8 +86,8 @@ if (LIBGCRYPT_LIBRARIES) unset(HAVE_LIBGCRYPT CACHE) endif() else () - message(STATUS "Install version > \"1.7.0\" to enable libgcrypt support " - "(found version \"${GCVER})\"") + message(STATUS "Install version >= \"1.7.0\" to enable libgcrypt support " + "(found version \"${GCVER}\")") endif() endif () endif () @@ -99,14 +99,19 @@ endif () find_package(OpenSSL QUIET) if (OPENSSL_FOUND) - set(DISABLE_OPENSSL FALSE CACHE BOOL "Disable OpenSSL support") - if (NOT DISABLE_OPENSSL) - message(STATUS "OpenSSL support enabled") - set(HAVE_OPENSSL TRUE) - else() - message(STATUS "OpenSSL support disabled by user") - unset(HAVE_OPENSSL) - endif() + if (OPENSSL_VERSION VERSION_LESS "1.1.0") + message(STATUS "Install version >= \"1.1.0\" to enable OpenSSL support " + "(found version \"${OPENSSL_VERSION}\")") + else () + set(DISABLE_OPENSSL FALSE CACHE BOOL "Disable OpenSSL support") + if (NOT DISABLE_OPENSSL) + message(STATUS "OpenSSL support enabled") + set(HAVE_OPENSSL TRUE) + else() + message(STATUS "OpenSSL support disabled") + unset(HAVE_OPENSSL) + endif() + endif () endif () if (NOT HAVE_OPENSSL) -- cgit v1.2.3