view cmake/Modules/FindGnuTLS.cmake @ 1441:6029afe9bacb

Update to 3GPP TS 29.214 V15.7.0 (2019-09) Add GCS-Identifier, OctetString, code 538, section 5.3.36 Add Sharing-Key-DL, Unsigned32, code 539, section 5.3.37 Add Sharing-Key-UL, Unsigned32, code 540, section 5.3.38 Add Retry-Interval, Unsigned32, code 541, section 5.3.39 Add Sponsoring-Action, Enumerated, code 542, section 5.3.40 Add Max-Supported-Bandwidth-DL, Unsigned32, code 543, section 5.3.41 Add Max-Supported-Bandwidth-UL, Unsigned32, code 544, section 5.3.42 Add Min-Desired-Bandwidth-DL, Unsigned32, code 545, section 5.3.43 Add Min-Desired-Bandwidth-UL, Unsigned32, code 546, section 5.3.44 Add MCPTT-Identifier, OctetString, code 547, section 5.3.45 Add Service-Authorization-Info, Unsigned32, code 548, section 5.3.46 Add Media-Component-Status, Unsigned32, code 549, section 5.3.48 Add Priority-Sharing-Indicator, Enumerated, code 550, section 5.3.47 Add AF-Requested-Data, Unsigned32, code 551, section 5.3.50 Add Content-Version, Unsigned64, code 552, section 5.3.49 Add Pre-emption-Control-Info, Unsigned32, code 553, section 5.3.51 Add Extended-Max-Requested-BW-DL, Unsigned32, code 554, section 5.3.52 Add Extended-Max-Requested-BW-UL, Unsigned32, code 555, section 5.3.53 Add Extended-Max-Supported-BW-DL, Unsigned32, code 556, section 5.3.54 Add Extended-Max-Supported-BW-UL, Unsigned32, code 557, section 5.3.55 Add Extended-Min-Desired-BW-DL, Unsigned32, code 558, section 5.3.56 Add Extended-Min-Desired-BW-UL, Unsigned32, code 559, section 5.3.57 Add Extended-Min-Requested-BW-DL, Unsigned32, code 560, section 5.3.58 Add Extended-Min-Requested-BW-UL, Unsigned32, code 561, section 5.3.59 Add MCVideo-Identifier, OctetString, code 562, section 5.3.45a Add IMS-Content-Identifier, OctetString, code 563, section 5.3.60 with missing M assumed to be MUST-NOT. Add IMS-Content-Type, Enumerated, code 564, section 5.3.61 with missing M assumed to be MUST-NOT.
author Luke Mewburn <luke@mewburn.net>
date Tue, 25 Feb 2020 10:42:08 +1100
parents 56c36d1007b4
children
line wrap: on
line source

# - Find gnutls
# Find the native GNUTLS includes and library
#
#  GNUTLS_FOUND - True if gnutls found.
#  GNUTLS_INCLUDE_DIR - where to find gnutls.h, etc.
#  GNUTLS_LIBRARIES - List of libraries when using gnutls.
#  GNUTLS_VERSION_210 - true if GnuTLS version is >= 2.10.0 (does not require additional separate gcrypt initialization)
#  GNUTLS_VERSION_212 - true if GnuTLS version is >= 2.12.0 (supports gnutls_transport_set_vec_push_function)
#  GNUTLS_VERSION_300 - true if GnuTLS version is >= 3.00.0 (x509 verification functions changed)
#  GNUTLS_VERSION_310 - true if GnuTLS version is >= 3.01.0 (stabilization branch with new APIs)

if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARIES)
  set(GNUTLS_FIND_QUIETLY TRUE)
endif (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARIES)

# Include dir
find_path(GNUTLS_INCLUDE_DIR
	NAMES
	  gnutls.h
	  gnutls/gnutls.h
)

# Library
find_library(GNUTLS_LIBRARY 
  NAMES gnutls
)

# handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if 
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNUTLS DEFAULT_MSG GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR)

IF(GNUTLS_FOUND)
  SET( GNUTLS_LIBRARIES ${GNUTLS_LIBRARY} )
ELSE(GNUTLS_FOUND)
  SET( GNUTLS_LIBRARIES )
ENDIF(GNUTLS_FOUND)

# Lastly make it so that the GNUTLS_LIBRARY and GNUTLS_INCLUDE_DIR variables
# only show up under the advanced options in the gui cmake applications.
MARK_AS_ADVANCED( GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR )

# Now check if the library is recent. gnutls_hash was added in 2.10.0.
# Also test library is even more recent. gnutls_x509_trust_list_verify_crt was added in 3.00.0.
IF(GNUTLS_FOUND)
  IF( NOT( "${GNUTLS_VERSION_TEST_FOR}" STREQUAL "${GNUTLS_LIBRARY}" ))
    INCLUDE (CheckLibraryExists) 
    MESSAGE(STATUS "Checking GNUTLS version")
    UNSET(GNUTLS_VERSION_210)
    UNSET(GNUTLS_VERSION_210 CACHE)
    UNSET(GNUTLS_VERSION_212)
    UNSET(GNUTLS_VERSION_212 CACHE)
    UNSET(GNUTLS_VERSION_300)
    UNSET(GNUTLS_VERSION_300 CACHE)
    UNSET(GNUTLS_VERSION_310)
    UNSET(GNUTLS_VERSION_310 CACHE)
    GET_FILENAME_COMPONENT(GNUTLS_PATH ${GNUTLS_LIBRARY} PATH)
    CHECK_LIBRARY_EXISTS(gnutls gnutls_hash ${GNUTLS_PATH} GNUTLS_VERSION_210) 
    CHECK_LIBRARY_EXISTS(gnutls gnutls_transport_set_vec_push_function ${GNUTLS_PATH} GNUTLS_VERSION_212) 
    CHECK_LIBRARY_EXISTS(gnutls gnutls_x509_trust_list_verify_crt ${GNUTLS_PATH} GNUTLS_VERSION_300) 
    CHECK_LIBRARY_EXISTS(gnutls gnutls_handshake_set_timeout ${GNUTLS_PATH} GNUTLS_VERSION_310) 
    SET( GNUTLS_VERSION_TEST_FOR ${GNUTLS_LIBRARY} CACHE INTERNAL "Version the test was made against" )
  ENDIF (NOT( "${GNUTLS_VERSION_TEST_FOR}" STREQUAL "${GNUTLS_LIBRARY}" ))
ENDIF(GNUTLS_FOUND)
"Welcome to our mercurial repository"