From 4304997180a1835c1ac9892eb1a27739896bb02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 12 Jan 2020 15:45:34 +0100 Subject: Fix building with avahi support + Avahi detection was not performed at all + Added missing avahi-client detection + Fixed FTBFS in avahi related code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit 281e2da7f14eca57104dbd3f7da39506011729a8) --- CMakeLists.txt | 19 +++++++++---------- config.h.cmake | 1 + dnssd/CMakeLists.txt | 2 +- dnssd/publicservice.cpp | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0a875094..e1f89c18b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1015,16 +1015,15 @@ endif( WITH_LUA ) ##### check for avahi ########################### if( WITH_AVAHI ) - if( WITH_QT4 ) - endif( WITH_QT4 ) - - if( WITH_QT3 ) - pkg_search_module( AVAHI avahi-tqt ) - if( NOT AVAHI_FOUND ) - message(FATAL_ERROR "\navahi support are requested, but not found on your system" ) - endif( NOT AVAHI_FOUND ) - set( AVAHI_API_0_6 1 ) - endif( WITH_QT3 ) + pkg_search_module( AVAHI_TQT avahi-tqt ) + pkg_search_module( AVAHI_CLIENT avahi-client ) + if( NOT AVAHI_TQT_FOUND OR NOT AVAHI_CLIENT_FOUND ) + tde_message_fatal( "avahi support is requested, but not found on your system" ) + endif( NOT AVAHI_TQT_FOUND OR NOT AVAHI_CLIENT_FOUND ) + if( NOT AVAHI_CLIENT_VERSION VERSION_LESS "0.6" ) + set( AVAHI_API_0_6 1 ) + endif( ) + set( HAVE_DNSSD 1 ) endif( ) diff --git a/config.h.cmake b/config.h.cmake index e0153f504..34a20bd6f 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -4,6 +4,7 @@ #define ASPELL_DATADIR "@ASPELL_DATADIR@" /* Avahi API 0.6 */ +#cmakedefine HAVE_DNSSD 1 #cmakedefine AVAHI_API_0_6 1 /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP diff --git a/dnssd/CMakeLists.txt b/dnssd/CMakeLists.txt index 01359672f..844ee16f4 100644 --- a/dnssd/CMakeLists.txt +++ b/dnssd/CMakeLists.txt @@ -44,7 +44,7 @@ set( ${target}_SRCS tde_add_library( ${target} SHARED AUTOMOC SOURCES ${${target}_SRCS} VERSION 1.0.0 - LINK tdecore-shared + LINK tdecore-shared ${AVAHI_TQT_LIBRARIES} ${AVAHI_CLIENT_LIBRARIES} DEPENDENCIES tdeconfig_compiler DESTINATION ${LIB_INSTALL_DIR} ) diff --git a/dnssd/publicservice.cpp b/dnssd/publicservice.cpp index 0313fd17c..05b891258 100644 --- a/dnssd/publicservice.cpp +++ b/dnssd/publicservice.cpp @@ -56,7 +56,7 @@ class PublicServicePrivate public: PublicServicePrivate() : m_published(false), m_running(false), m_collision(false) #ifdef HAVE_DNSSD - , m_group(false) + , m_group(0) #endif {} bool m_published; -- cgit v1.2.1