From cc69299ea39bd39caad54ae349564e22593eb4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Lucr=C3=A8ce=20C=C3=A9leste?= Date: Mon, 2 Jul 2018 23:21:08 -0400 Subject: [PATCH] Merge pkgconfig branch into master (#86) * use pkg-config for finding avahi include dir * [Travis] bring up to date --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bc2cfaf..2a3308aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,6 +63,7 @@ if (UNIX) include (CheckIncludeFileCXX) include (CheckSymbolExists) include (CheckCSourceCompiles) + include (FindPkgConfig) check_include_file_cxx (istream HAVE_ISTREAM) check_include_file_cxx (ostream HAVE_OSTREAM) @@ -162,6 +163,11 @@ if (UNIX) include_directories("/usr/local/include" "/usr/local/include/avahi-compat-libdns_sd") link_directories("/usr/local/lib") endif() + if (${PKG_CONFIG_FOUND}) + pkg_check_modules (AVAHI_COMPAT REQUIRED avahi-compat-libdns_sd) + include_directories (BEFORE SYSTEM ${AVAHI_COMPAT_INCLUDE_DIRS}) + set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${AVAHI_COMPAT_INCLUDE_DIRS}") + endif () set (XKBlib "X11/Xlib.h;X11/XKBlib.h") set (CMAKE_EXTRA_INCLUDE_FILES "${XKBlib};X11/extensions/Xrandr.h")