diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-09-25 12:09:23 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-10-01 08:14:34 +0000 |
commit | 9506909223f6155085a7a4d5adc039ebf60030f2 (patch) | |
tree | 56fa8255ec510c82e412ebff32f7e0b0bab705d9 /cmake/modules/FindZLIB.cmake | |
parent | 0ac441b3ec36a65090721ffaf8bf668dd1b0bbbb (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/FindZLIB.cmake')
-rw-r--r-- | cmake/modules/FindZLIB.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/modules/FindZLIB.cmake b/cmake/modules/FindZLIB.cmake index 0faf7aa1b9..956046f075 100644 --- a/cmake/modules/FindZLIB.cmake +++ b/cmake/modules/FindZLIB.cmake @@ -35,10 +35,14 @@ INCLUDE(FindWSWinLibs) FindWSWinLibs("zlib" "ZLIB_HINTS") +find_package(PkgConfig) +pkg_search_module(ZLIB zlib) + FIND_PATH(ZLIB_INCLUDE_DIR NAMES zlib.h HINTS + "${ZLIB_INCLUDEDIR}" ${ZLIB_HINTS}/include ${ZLIB_HINTS} PATHS @@ -50,6 +54,7 @@ FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} HINTS + "${ZLIB_LIBDIR}" ${ZLIB_HINTS}/lib ${ZLIB_HINTS} PATHS |