FindWaylandProtocols.cmake 1.25 KB
Newer Older
Vlad Zahorodnii's avatar
Vlad Zahorodnii committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#.rst:
# FindWaylandProtocols
# -------
#
# Try to find wayland-protocols on a Unix system.
#
# This will define the following variables:
#
# ``WaylandProtocols_FOUND``
#     True if (the requested version of) wayland-protocols is available
# ``WaylandProtocols_VERSION``
#     The version of wayland-protocols
# ``WaylandProtocols_DATADIR``
#     The wayland protocols data directory

#=============================================================================
17
# SPDX-FileCopyrightText: 2019 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Vlad Zahorodnii's avatar
Vlad Zahorodnii committed
18
#
19
# SPDX-License-Identifier: BSD-3-Clause
Vlad Zahorodnii's avatar
Vlad Zahorodnii committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#=============================================================================

find_package(PkgConfig)
pkg_check_modules(PKG_wayland_protocols QUIET wayland-protocols)

set(WaylandProtocols_VERSION ${PKG_wayland_protocols_VERSION})
pkg_get_variable(WaylandProtocols_DATADIR wayland-protocols pkgdatadir)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WaylandProtocols
    FOUND_VAR WaylandProtocols_FOUND
    REQUIRED_VARS WaylandProtocols_DATADIR
    VERSION_VAR WaylandProtocols_VERSION
)

include(FeatureSummary)
set_package_properties(WaylandProtocols PROPERTIES
    DESCRIPTION "Specifications of extended Wayland protocols"
    URL "https://wayland.freedesktop.org/"
)