comparison 3rdparty/vmime/cmake/FindGSasl.cmake @ 0:a4671277546c tip

created the repository for the thymian project
author ferencd
date Tue, 17 Aug 2021 11:19:54 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:a4671277546c
1 # - Try to find the GNU sasl library (gsasl)
2 #
3 # Once done this will define
4 #
5 # GNUTLS_FOUND - System has gnutls
6 # GNUTLS_INCLUDE_DIR - The gnutls include directory
7 # GNUTLS_LIBRARIES - The libraries needed to use gnutls
8 # GNUTLS_DEFINITIONS - Compiler switches required for using gnutls
9
10 # Adapted from FindGnuTLS.cmake, which is:
11 # Copyright 2009, Brad Hards, <bradh@kde.org>
12 #
13 # Changes are Copyright 2009, Michele Caini, <skypjack@gmail.com>
14 #
15 # Redistribution and use is allowed according to the terms of the BSD license.
16 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
17
18
19 IF (GSASL_INCLUDE_DIR AND GSASL_LIBRARIES)
20 # in cache already
21 SET(GSasl_FIND_QUIETLY TRUE)
22 ENDIF (GSASL_INCLUDE_DIR AND GSASL_LIBRARIES)
23
24 IF (NOT WIN32)
25 # use pkg-config to get the directories and then use these values
26 # in the FIND_PATH() and FIND_LIBRARY() calls
27 find_package(PkgConfig)
28 pkg_check_modules(PC_GSASL libgsasl)
29 SET(GSASL_DEFINITIONS ${PC_GSASL_CFLAGS_OTHER})
30 ENDIF (NOT WIN32)
31
32 FIND_PATH(GSASL_INCLUDE_DIR gsasl.h
33 HINTS
34 ${PC_GSASL_INCLUDEDIR}
35 ${PC_GSASL_INCLUDE_DIRS}
36 PATH_SUFFIXES gsasl
37 )
38
39 FIND_LIBRARY(GSASL_LIBRARIES NAMES gsasl libgsasl
40 HINTS
41 ${PC_GSASL_LIBDIR}
42 ${PC_GSASL_LIBRARY_DIRS}
43 )
44
45 INCLUDE(FindPackageHandleStandardArgs)
46
47 # handle the QUIETLY and REQUIRED arguments and set GSASL_FOUND to TRUE if
48 # all listed variables are TRUE
49 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GSASL DEFAULT_MSG GSASL_LIBRARIES GSASL_INCLUDE_DIR)
50
51 MARK_AS_ADVANCED(GSASL_INCLUDE_DIR GSASL_LIBRARIES)