aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindGNUTLS.cmake
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-09-25 12:09:23 +0200
committerAnders Broman <a.broman58@gmail.com>2014-10-01 08:14:34 +0000
commit9506909223f6155085a7a4d5adc039ebf60030f2 (patch)
tree56fa8255ec510c82e412ebff32f7e0b0bab705d9 /cmake/modules/FindGNUTLS.cmake
parent0ac441b3ec36a65090721ffaf8bf668dd1b0bbbb (diff)
cmake: use pkg-config for resolving dependencies
Changes: * Fix glib2 search path. * Add pkg-config support to CAP, GEOIP, GNUTLS, LUA, PortAudio (API 19), zlib, kerberos. * Add pkg-config support to libnl3, libnl2 and libnl1 (but tested only with libnl3). This makes it easier to do 32-bit builds on 64-bit hosts by just setting `PKG_CONFIG_LIBDIR`. Due to how HINTS work, it is still fragile though: missing 32-bit libraries will cause a fallback to 64-bit libraries. A future patch could check for `<PREFIX>_FOUND` and remove the manual `find_path` and `find_library` hackery since the paths are already known. Change-Id: Ieb4fb74695c96afb1a4c70168e84abb1fa4612c6 Reviewed-on: https://code.wireshark.org/review/4292 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'cmake/modules/FindGNUTLS.cmake')
-rw-r--r--cmake/modules/FindGNUTLS.cmake30
1 files changed, 21 insertions, 9 deletions
diff --git a/cmake/modules/FindGNUTLS.cmake b/cmake/modules/FindGNUTLS.cmake
index f06835fc44..492fd8f41a 100644
--- a/cmake/modules/FindGNUTLS.cmake
+++ b/cmake/modules/FindGNUTLS.cmake
@@ -15,20 +15,32 @@ ENDIF (GNUTLS_INCLUDE_DIRS)
INCLUDE(FindWSWinLibs)
FindWSWinLibs("gnutls-.*" "GNUTLS_HINTS")
+find_package(PkgConfig)
+pkg_search_module(GNUTLS gnutls)
+
FIND_PATH(GNUTLS_INCLUDE_DIR
- NAMES
- gnutls.h
- gnutls/gnutls.h
- PATH_SUFFIXES
- include
- HINTS
- ${GNUTLS_HINTS}
+ NAMES
+ gnutls.h
+ gnutls/gnutls.h
+ PATH_SUFFIXES
+ include
+ HINTS
+ "${GNUTLS_INCLUDEDIR}"
+ "${GNUTLS_HINTS}"
)
SET(GNUTLS_NAMES gnutls libgnutls-28)
-FIND_LIBRARY(GNUTLS_LIBRARY NAMES ${GNUTLS_NAMES} libgmp-10 libgcc_s_sjlj-1 libffi-6 libhogweed-2-4 libnettle-4-6 libp11-kit-0 libtasn1-6 HINTS "${GNUTLS_HINTS}/bin" )
+FIND_LIBRARY(GNUTLS_LIBRARY
+ NAMES
+ ${GNUTLS_NAMES}
+ libgmp-10 libgcc_s_sjlj-1 libffi-6 libhogweed-2-4 libnettle-4-6
+ libp11-kit-0 libtasn1-6
+ HINTS
+ "${GNUTLS_LIBDIR}"
+ "${GNUTLS_HINTS}/bin"
+)
-# handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if
+# 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)