2022-05-05 16:35:55 +03:00
|
|
|
# Try to find Avahi library, once done this will define:
|
2020-03-25 01:41:20 +00:00
|
|
|
#
|
|
|
|
# AVAHI_FOUND - system has Avahi
|
|
|
|
# AVAHI_INCLUDE_DIR - the Avahi include directory
|
2022-05-05 16:35:55 +03:00
|
|
|
# AVAHI_LIBRARIES - the libraries needed to use Avahi
|
2020-03-25 01:41:20 +00:00
|
|
|
#
|
2021-03-07 02:40:21 +02:00
|
|
|
# Copyright (c) 2020 Ivailo Monev <xakepa10@gmail.com>
|
2014-11-13 01:04:59 +02:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
|
2022-05-05 16:35:55 +03:00
|
|
|
if(NOT WIN32)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
pkg_check_modules(PC_AVAHI QUIET avahi-client)
|
|
|
|
|
|
|
|
set(AVAHI_INCLUDE_DIR ${PC_AVAHI_INCLUDE_DIRS})
|
|
|
|
set(AVAHI_LIBRARIES ${PC_AVAHI_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(AVAHI_VERSION ${PC_AVAHI_VERSION})
|
|
|
|
|
|
|
|
if(NOT AVAHI_INCLUDE_DIR OR NOT AVAHI_LIBRARIES)
|
|
|
|
find_path(AVAHI_INCLUDE_DIR
|
|
|
|
NAMES avahi-client/client.h
|
|
|
|
HINTS $ENV{AVAHIDIR}/include
|
|
|
|
)
|
|
|
|
|
|
|
|
find_library(AVAHI_LIBRARIES
|
|
|
|
NAMES avahi-client
|
|
|
|
HINTS $ENV{AVAHIDIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
2014-11-13 01:04:59 +02:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-03-25 01:41:20 +00:00
|
|
|
find_package_handle_standard_args(Avahi
|
2022-05-05 16:35:55 +03:00
|
|
|
VERSION_VAR AVAHI_VERSION
|
|
|
|
REQUIRED_VARS AVAHI_LIBRARIES AVAHI_INCLUDE_DIR
|
2020-03-25 01:41:20 +00:00
|
|
|
)
|
2022-05-05 16:35:55 +03:00
|
|
|
|
|
|
|
mark_as_advanced(AVAHI_INCLUDE_DIR AVAHI_LIBRARIES)
|