aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrian Hinz <bphinz@users.sourceforge.net>2014-02-19 05:19:37 +0000
committerBrian Hinz <bphinz@users.sourceforge.net>2014-02-19 05:19:37 +0000
commit236b019980eb6e3eeb847705c4cbd795afc873b0 (patch)
treea67d62c40ce05527b4e1c6a44c394fbcdcf4e4fb /CMakeLists.txt
parent65c9858dbc4637324131109c991d07b43d5cca4d (diff)
downloadtigervnc-236b019980eb6e3eeb847705c4cbd795afc873b0.tar.gz
tigervnc-236b019980eb6e3eeb847705c4cbd795afc873b0.zip
Fixes problems with cmake detection of GnuTLS. The current CMakeLists.txt uses check_function_exists to identify legacy versions of GnuTLS but cmake performs this test by linking a small test program. If libgnutls, libgcrypt, or libgpg-error are outside the default library search path, linking the test program fails even though gnutls and it's dependencies are installed. This patch makes it possible to specify the location of each of the three libraries independently and only as needed.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5160 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 46895666..0c78d15c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -303,8 +303,20 @@ endif()
option(ENABLE_GNUTLS "Enable protocol encryption and advanced authentication" ON)
if(ENABLE_GNUTLS)
find_package(GnuTLS)
+ find_package(Gcrypt)
+ find_package(Gpg_Error)
if (GNUTLS_FOUND)
include_directories(${GNUTLS_INCLUDE_DIR})
+ if (GCRYPT_FOUND)
+ include_directories(${GCRYPT_INCLUDE_DIR})
+ set(GNUTLS_LIBRARIES ${GNUTLS_LIBRARIES};${GCRYPT_LIBRARIES})
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${GCRYPT_LIBRARIES})
+ if (GPG_ERROR_FOUND)
+ include_directories(${GPG_ERROR_INCLUDE_DIR})
+ set(GNUTLS_LIBRARIES ${GNUTLS_LIBRARIES};${GPG_ERROR_LIBRARIES})
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${GPG_ERROR_LIBRARIES})
+ endif()
+ endif()
add_definitions("-DHAVE_GNUTLS")
add_definitions(${GNUTLS_DEFINITIONS})