include_directories(${GNUTLS_INCLUDE_DIR})
add_definitions("-DHAVE_GNUTLS")
add_definitions(${GNUTLS_DEFINITIONS})
+
+ # Detect old version of GnuTLS
+ set(CMAKE_EXTRA_INCLUDE_FILES gnutls/gnutls.h)
+ set(CMAKE_REQUIRED_LIBRARIES gnutls)
+ check_function_exists(gnutls_transport_set_global_errno HAVE_OLD_GNUTLS)
+ check_function_exists(gnutls_x509_crt_print HAVE_GNUTLS_X509_CRT_PRINT)
+ check_type_size(gnutls_x509_crt_t GNUTLS_CRT_T)
+ check_type_size(gnutls_datum_t GNUTLS_DATUM_T)
+ check_type_size(gnutls_pk_algorithm_t GNUTLS_PK_ALGORITHM_T)
+ check_type_size(gnutls_sign_algorithm_t GNUTLS_SIGN_ALGORITHM_T)
+ set(CMAKE_EXTRA_INCLUDE_FILES)
+ set(CMAKE_REQUIRED_LIBRARIES)
endif()
# Check for socket functions
#cmakedefine HAVE_STRCASECMP
#cmakedefine HAVE_STRNCASECMP
#cmakedefine HAVE_VSNPRINTF
+#cmakedefine HAVE_OLD_GNUTLS
+#cmakedefine HAVE_GNUTLS_X509_CRT_PRINT
+#cmakedefine HAVE_GNUTLS_CRT_T
+#cmakedefine HAVE_GNUTLS_DATUM_T
+#cmakedefine HAVE_GNUTLS_PK_ALGORITHM_T
+#cmakedefine HAVE_GNUTLS_SIGN_ALGORITHM_T
/* MS Visual Studio 2008 and newer doesn't know ssize_t */
#if defined(HAVE_GNUTLS) && defined(WIN32) && !defined(__MINGW32__)