FindGnuTLS¶
Finds the GNU Transport Layer Security library (GnuTLS):
find_package(GnuTLS [<version>] [...])
The GnuTLS package includes the main libraries (libgnutls and libdane), as well as the optional gnutls-openssl compatibility extra library. They are all distributed as part of the same release. This module checks for the presence of the main libgnutls library and provides usage requirements for integrating GnuTLS into CMake projects.
Imported Targets¶
This module provides the following Imported Targets:
GnuTLS::GnuTLS在 3.16 版被加入.
Target encapsulating the GnuTLS usage requirements, available if GnuTLS is found.
結果變數¶
該模組定義了以下變數:
GnuTLS_FOUND在 3.3 版被加入.
布林值,表示是否找到了(所請求版本的)GnuTLS。
GnuTLS_VERSION在 4.2 版被加入.
The version of GnuTLS found.
GNUTLS_INCLUDE_DIRS使用 GnuTLS 所需的引入目錄。
GNUTLS_LIBRARIES使用 GnuTLS 所需連結的程式庫。
GNUTLS_DEFINITIONS使用 GnuTLS 所需的編譯器選項。
快取變數¶
還可能設定以下變數:
GNUTLS_INCLUDE_DIR包含
gnutls/gnutls.h標頭檔的目錄。GNUTLS_LIBRARYGnuTLS 程式庫的路徑。
棄用的變數¶
The following variables are provided for backward compatibility:
GNUTLS_FOUND在 4.2 版之後被棄用: Use
GnuTLS_FOUND, which has the same value.布林值,表示是否找到了(所請求版本的)GnuTLS。
GNUTLS_VERSION_STRING在 3.16 版之後被棄用: Use the
GnuTLS_VERSION, which has the same value.GNUTLS_VERSION在 3.16 版被加入.
在 4.2 版之後被棄用: Use the
GnuTLS_VERSION, which has the same value.
範例¶
Finding GnuTLS and linking it to a project target:
find_package(GnuTLS)
target_link_libraries(project_target PRIVATE GnuTLS::GnuTLS)