From cfcaf0fb813f59d498626914fb358c1f0034b317 Mon Sep 17 00:00:00 2001 From: hax0kartik Date: Sun, 1 Mar 2020 08:42:39 -0800 Subject: [PATCH] Change how cmake looks for gnutls and gnutls-openssl --- CMakeLists.txt | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6906f57b2..e56e6dd90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,6 +430,11 @@ endif(GCRYPT_LIBRARIES) find_library(GNUTLS_LIBRARIES gnutls) if(GNUTLS_LIBRARIES) set(HAVE_LIBGNUTLS 1) + find_library(GNUTLS_OPENSSL_LIBRARIES gnutls-openssl) + if(GNUTLS_OPENSSL_LIBRARIES) + list(APPEND ZM_BIN_LIBS "${GNUTLS_OPENSSL_LIBRARIES}") + check_include_file("gnutls/openssl.h" HAVE_GNUTLS_OPENSSL_H) + endif(GNUTLS_OPENSSL_LIBRARIES) list(APPEND ZM_BIN_LIBS "${GNUTLS_LIBRARIES}") find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h) if(GNUTLS_INCLUDE_DIR) @@ -443,21 +448,6 @@ else(GNUTLS_LIBRARIES) set(optlibsnotfound "${optlibsnotfound} GnuTLS") endif(GNUTLS_LIBRARIES) -find_library(GNUTLS_OPENSSL_LIBRARIES gnutls-openssl) -if(GNUTLS_OPENSSL_LIBRARIES) - list(APPEND ZM_BIN_LIBS "${GNUTLS_OPENSSL_LIBRARIES}") - find_path(GNUTLS_INCLUDE_DIR gnutls/openssl.h) - if(GNUTLS_INCLUDE_DIR) - include_directories("${GNUTLS_INCLUDE_DIR}") - set(CMAKE_REQUIRED_INCLUDES "${GNUTLS_INCLUDE_DIR}") - endif(GNUTLS_INCLUDE_DIR) - mark_as_advanced(FORCE GNUTLS_LIBRARIES GNUTLS_INCLUDE_DIR) - check_include_file("gnutls/openssl.h" HAVE_GNUTLS_OPENSSL_H) - set(optlibsfound "${optlibsfound} GnuTLS_OEPNSSL") -else(GNUTLS_OPENSSL_LIBRARIES) - set(optlibsnotfound "${optlibsnotfound} GnuTLS_OPENSSL") -endif(GNUTLS_OPENSSL_LIBRARIES) - # mysqlclient (using find_library and find_path) find_library(MYSQLCLIENT_LIBRARIES mysqlclient PATH_SUFFIXES mysql) if(MYSQLCLIENT_LIBRARIES)