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/FindGEOIP.cmake | |
parent | 0ac441b3ec36a65090721ffaf8bf668dd1b0bbbb (diff) | |
download | wireshark-9506909223f6155085a7a4d5adc039ebf60030f2.tar.gz |
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/FindGEOIP.cmake')
-rw-r--r-- | cmake/modules/FindGEOIP.cmake | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/cmake/modules/FindGEOIP.cmake b/cmake/modules/FindGEOIP.cmake index c166eeec07..add3187eca 100644 --- a/cmake/modules/FindGEOIP.cmake +++ b/cmake/modules/FindGEOIP.cmake @@ -15,12 +15,23 @@ ENDIF (GEOIP_INCLUDE_DIRS) INCLUDE(FindWSWinLibs) FindWSWinLibs("GeoIP-.*" "GEOIP_HINTS") -FIND_PATH(GEOIP_INCLUDE_DIR GeoIP.h HINTS "${GEOIP_HINTS}/include" ) +find_package(PkgConfig) +pkg_search_module(GEOIP geoip) + +FIND_PATH(GEOIP_INCLUDE_DIR GeoIP.h + HINTS + "${GEOIP_INCLUDEDIR}" + "${GEOIP_HINTS}/include" +) SET(GEOIP_NAMES GeoIP libGeoIP-1) -FIND_LIBRARY(GEOIP_LIBRARY NAMES ${GEOIP_NAMES} HINTS "${GEOIP_HINTS}/lib" ) +FIND_LIBRARY(GEOIP_LIBRARY NAMES ${GEOIP_NAMES} + HINTS + "${GEOIP_LIBDIR}" + "${GEOIP_HINTS}/lib" + ) -# handle the QUIETLY and REQUIRED arguments and set GEOIP_FOUND to TRUE if +# handle the QUIETLY and REQUIRED arguments and set GEOIP_FOUND to TRUE if # all listed variables are TRUE INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(GEOIP DEFAULT_MSG GEOIP_LIBRARY GEOIP_INCLUDE_DIR) |