2
# Find GNUTLS headers, libraries and the answer to all questions.
4
# GNUTLS_FOUND True if gnutls got found
5
# GNUTLS_INCLUDE_DIRS Location of gnutls headers
6
# GNUTLS_LIBRARIES List of libaries to use gnutls
8
# Copyright (c) 2007 Bjoern Ricks <b.ricks@fh-osnabrueck.de>
10
# Redistribution and use is allowed according to the terms of the New
12
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
15
INCLUDE( FindPkgConfig )
17
IF ( GNUTLS_FIND_REQUIRED )
18
SET( _pkgconfig_REQUIRED "REQUIRED" )
19
ELSE( GNUTLS_FIND_REQUIRED )
20
SET( _pkgconfig_REQUIRED "" )
21
ENDIF ( GNUTLS_FIND_REQUIRED )
23
IF ( GNUTLS_MIN_VERSION )
24
PKG_SEARCH_MODULE( GNUTLS ${_pkgconfig_REQUIRED} gnutls>=${GNUTLS_MIN_VERSION} )
25
ELSE ( GNUTLS_MIN_VERSION )
26
PKG_SEARCH_MODULE( GNUTLS ${_pkgconfig_REQUIRED} gnutls )
27
ENDIF ( GNUTLS_MIN_VERSION )
30
IF( NOT GNUTLS_FOUND AND NOT PKG_CONFIG_FOUND )
31
FIND_PATH( GNUTLS_INCLUDE_DIRS gnutls/gnutls.h )
32
FIND_LIBRARY( GNUTLS_LIBRARIES gnutls)
35
IF ( GNUTLS_LIBRARIES AND GNUTLS_INCLUDE_DIRS )
37
IF ( NOT GNUTLS_FIND_QUIETLY )
38
MESSAGE( STATUS "Found gnutls: ${GNUTLS_LIBRARIES}" )
39
ENDIF ( NOT GNUTLS_FIND_QUIETLY )
40
ELSE ( GNUTLS_LIBRARIES AND GNUTLS_INCLUDE_DIRS )
41
IF ( GNUTLS_FIND_REQUIRED )
42
MESSAGE( SEND_ERROR "Could NOT find gnutls" )
43
ELSE ( GNUTLS_FIND_REQUIRED )
44
IF ( NOT GNUTLS_FIND_QUIETLY )
45
MESSAGE( STATUS "Could NOT find gnutls" )
46
ENDIF ( NOT GNUTLS_FIND_QUIETLY )
47
ENDIF ( GNUTLS_FIND_REQUIRED )
48
ENDIF ( GNUTLS_LIBRARIES AND GNUTLS_INCLUDE_DIRS )
49
ENDIF( NOT GNUTLS_FOUND AND NOT PKG_CONFIG_FOUND )
51
MARK_AS_ADVANCED( GNUTLS_LIBRARIES GNUTLS_INCLUDE_DIRS )