diff options
author | Pierre Ossman <ossman@cendio.se> | 2011-05-30 12:22:39 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2011-05-30 12:22:39 +0000 |
commit | 950642027b17daaa8dc4cd145b60aeaae1a1f836 (patch) | |
tree | 3857285e71ac9b9390178c33f9543fcb58212d02 /CMakeLists.txt | |
parent | d790715df1cc503c7e07e13c9dfe5edec2304fa5 (diff) | |
download | tigervnc-950642027b17daaa8dc4cd145b60aeaae1a1f836.tar.gz tigervnc-950642027b17daaa8dc4cd145b60aeaae1a1f836.zip |
Reenable the automatic enabling of GnuTLS if present, but retain the ability
to explicitly disable it.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4457 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c25fb1c..84a74d7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -208,25 +208,26 @@ if(BUILD_NEW_VNCVIEWER) endif() # Check for GNUTLS library -option(ENABLE_GNUTLS "Enable protocol encryption and advanced authentication") +option(ENABLE_GNUTLS "Enable protocol encryption and advanced authentication" ON) if(ENABLE_GNUTLS) - find_package(GnuTLS REQUIRED) - - include_directories(${GNUTLS_INCLUDE_DIR}) - add_definitions("-DHAVE_GNUTLS") - add_definitions(${GNUTLS_DEFINITIONS}) - - # Detect old version of GnuTLS - set(CMAKE_EXTRA_INCLUDE_FILES gnutls/gnutls.h) - set(CMAKE_REQUIRED_LIBRARIES gnutls) - check_function_exists(gnutls_transport_set_global_errno HAVE_OLD_GNUTLS) - check_function_exists(gnutls_x509_crt_print HAVE_GNUTLS_X509_CRT_PRINT) - check_type_size(gnutls_x509_crt_t GNUTLS_X509_CRT_T) - check_type_size(gnutls_datum_t GNUTLS_DATUM_T) - check_type_size(gnutls_pk_algorithm_t GNUTLS_PK_ALGORITHM_T) - check_type_size(gnutls_sign_algorithm_t GNUTLS_SIGN_ALGORITHM_T) - set(CMAKE_EXTRA_INCLUDE_FILES) - set(CMAKE_REQUIRED_LIBRARIES) + find_package(GnuTLS) + if (GNUTLS_FOUND) + include_directories(${GNUTLS_INCLUDE_DIR}) + add_definitions("-DHAVE_GNUTLS") + add_definitions(${GNUTLS_DEFINITIONS}) + + # Detect old version of GnuTLS + set(CMAKE_EXTRA_INCLUDE_FILES gnutls/gnutls.h) + set(CMAKE_REQUIRED_LIBRARIES gnutls) + check_function_exists(gnutls_transport_set_global_errno HAVE_OLD_GNUTLS) + check_function_exists(gnutls_x509_crt_print HAVE_GNUTLS_X509_CRT_PRINT) + check_type_size(gnutls_x509_crt_t GNUTLS_X509_CRT_T) + check_type_size(gnutls_datum_t GNUTLS_DATUM_T) + check_type_size(gnutls_pk_algorithm_t GNUTLS_PK_ALGORITHM_T) + check_type_size(gnutls_sign_algorithm_t GNUTLS_SIGN_ALGORITHM_T) + set(CMAKE_EXTRA_INCLUDE_FILES) + set(CMAKE_REQUIRED_LIBRARIES) + endif() endif() # Check for socket functions |