blob: fd4517dafbe67dc6ed47c6b3da1a4cccb3f2fdf1 [file] [log] [blame]
Brian Waters13d96012017-12-08 16:53:31 -06001# - Find gnutls
2# Find the native GCRYPT includes and library
3#
4# GCRYPT_FOUND - True if gnutls found.
5# GCRYPT_INCLUDE_DIR - where to find gnutls.h, etc.
6# GCRYPT_LIBRARIES - List of libraries when using gnutls.
7
8if (GCRYPT_INCLUDE_DIR AND GCRYPT_LIBRARIES)
9 set(GCRYPT_FIND_QUIETLY TRUE)
10endif (GCRYPT_INCLUDE_DIR AND GCRYPT_LIBRARIES)
11
12# Include dir
13find_path(GCRYPT_INCLUDE_DIR
14 NAMES
15 gcrypt.h
16)
17
18# Library
19find_library(GCRYPT_LIBRARY
20 NAMES gcrypt
21)
22
23# handle the QUIETLY and REQUIRED arguments and set GCRYPT_FOUND to TRUE if
24# all listed variables are TRUE
25INCLUDE(FindPackageHandleStandardArgs)
26FIND_PACKAGE_HANDLE_STANDARD_ARGS(GCRYPT DEFAULT_MSG GCRYPT_LIBRARY GCRYPT_INCLUDE_DIR)
27
28IF(GCRYPT_FOUND)
29 SET( GCRYPT_LIBRARIES ${GCRYPT_LIBRARY} )
30ELSE(GCRYPT_FOUND)
31 SET( GCRYPT_LIBRARIES )
32ENDIF(GCRYPT_FOUND)
33
34# Lastly make it so that the GCRYPT_LIBRARY and GCRYPT_INCLUDE_DIR variables
35# only show up under the advanced options in the gui cmake applications.
36MARK_AS_ADVANCED( GCRYPT_LIBRARY GCRYPT_INCLUDE_DIR )