Welcome to mirror list, hosted at ThFree Co, Russian Federation.

FindAVAHI.cmake « cmake - gitlab.com/Remmina/Remmina.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d7ec2940d4d1d96069ea7231d3bf78befc6e3f9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Remmina - The GTK+ Remote Desktop Client
#
# Copyright (C) 2011 Marc-Andre Moreau
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, 
# Boston, MA  02110-1301, USA.

include(FindPkgConfig)

if(PKG_CONFIG_FOUND)
	pkg_check_modules(PC_AVAHI_CLIENT avahi-client)
	if(GTK3_FOUND)
		set(_AVAHI_UI_LIB_NAME avahi-ui-gtk3)
		set(_AVAHI_UI_PKG_NAME avahi-ui-gtk3>=0.6.30 avahi-client>=0.6.30)
	endif()
	pkg_check_modules(PC_AVAHI_UI ${_AVAHI_UI_PKG_NAME})
endif()


find_library(AVAHI_COMMON_LIBRARY NAMES avahi-common PATHS ${PC_AVAHI_CLIENT_LIBRARY_DIRS})
if(AVAHI_COMMON_LIBRARY)
	set(AVAHI_COMMON_FOUND TRUE)
endif()

find_library(AVAHI_CLIENT_LIBRARY NAMES avahi-client PATHS ${PC_AVAHI_CLIENT_LIBRARY_DIRS})
if(AVAHI_CLIENT_LIBRARY)
	set(AVAHI_CLIENT_FOUND TRUE)
endif()

find_path(AVAHI_UI_INCLUDE_DIR avahi-ui/avahi-ui.h PATHS ${PC_AVAHI_UI_INCLUDE_DIRS})
find_library(AVAHI_UI_LIBRARY NAMES ${_AVAHI_UI_LIB_NAME} PATHS ${PC_AVAHI_UI_LIBRARY_DIRS})
if(AVAHI_UI_INCLUDE_DIR AND AVAHI_UI_LIBRARY)
	set(AVAHI_UI_FOUND TRUE)
endif()

FIND_PACKAGE_HANDLE_STANDARD_ARGS(AVAHI DEFAULT_MSG AVAHI_COMMON_FOUND AVAHI_CLIENT_FOUND AVAHI_UI_FOUND)

if (AVAHI_FOUND)
	set(AVAHI_INCLUDE_DIRS ${AVAHI_UI_INCLUDE_DIR})
	set(AVAHI_LIBRARIES ${AVAHI_COMMON_LIBRARY} ${AVAHI_CLIENT_LIBRARY} ${AVAHI_UI_LIBRARY})
endif()

mark_as_advanced(AVAHI_INCLUDE_DIRS AVAHI_LIBRARIES)