2021-03-07 02:40:21 +02:00
|
|
|
# Try to find the libgcrypt library, once done this will define:
|
2015-10-29 10:09:43 +02:00
|
|
|
#
|
|
|
|
# LIBGCRYPT_FOUND - system has libgcrypt
|
|
|
|
# LIBGCRYPT_INCLUDE_DIR - the libgcrypt include directory
|
2020-03-24 03:26:51 +00:00
|
|
|
# LIBGCRYPT_LIBRARIES - the libraries needed to use libgcrypt
|
|
|
|
#
|
2021-03-07 02:40:21 +02:00
|
|
|
# Copyright (c) 2020 Ivailo Monev <xakepa10@gmail.com>
|
2015-10-29 10:09:43 +02:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
|
2021-03-27 22:07:50 +02:00
|
|
|
if(NOT WIN32)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
pkg_check_modules(PC_LIBGCRYPT QUIET libgcrypt)
|
2020-03-24 03:26:51 +00:00
|
|
|
|
2021-03-27 22:07:50 +02:00
|
|
|
set(LIBGCRYPT_INCLUDE_DIR ${PC_LIBGCRYPT_INCLUDE_DIRS})
|
|
|
|
set(LIBGCRYPT_LIBRARIES ${PC_LIBGCRYPT_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(LIBGCRYPT_VERSION ${PC_LIBGCRYPT_VERSION})
|
|
|
|
|
|
|
|
if(NOT LIBGCRYPT_INCLUDE_DIR OR NOT LIBGCRYPT_LIBRARIES)
|
|
|
|
find_path(LIBGCRYPT_INCLUDE_DIR
|
|
|
|
NAMES gcrypt.h
|
|
|
|
PATH_SUFFIXES libgcrypt
|
|
|
|
HINTS $ENV{LIBGCRYPTDIR}/include
|
|
|
|
)
|
|
|
|
|
|
|
|
find_library(LIBGCRYPT_LIBRARIES
|
|
|
|
NAMES gcrypt
|
|
|
|
HINTS $ENV{LIBGCRYPTDIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
2015-10-29 10:09:43 +02:00
|
|
|
|
2020-03-24 03:26:51 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(LibGcrypt
|
2021-03-27 22:07:50 +02:00
|
|
|
VERSION_VAR LIBGCRYPT_VERSION
|
2020-03-24 03:26:51 +00:00
|
|
|
REQUIRED_VARS LIBGCRYPT_LIBRARIES LIBGCRYPT_INCLUDE_DIR
|
2021-03-27 22:07:50 +02:00
|
|
|
)
|