kwin/cmake/modules/FindXwayland.cmake
Vlad Zahorodnii 6a26540065 wayland: Query pkg-config if Xwayland supports listenfd
-listen <fd> option is deprecated in favor of the -listenfd option. This
change makes kwin query whether Xwayland supports the -listenfd option
at build time. If the pkg-config file is missing, we'll use the old listen
option.
2021-03-02 13:29:22 +00:00

39 lines
1.1 KiB
CMake

#.rst:
# FindXwayland
# -------
#
# Try to find Xwayland on a Unix system.
#
# This will define the following variables:
#
# ``Xwayland_FOUND``
# True if (the requested version of) Xwayland is available
# ``Xwayland_VERSION``
# The version of Xwayland
# ``Xwayland_HAVE_LISTENFD``
# True if (the requested version of) Xwayland has -listenfd option
#=============================================================================
# SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
# SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#=============================================================================
find_package(PkgConfig)
pkg_check_modules(PKG_xwayland QUIET xwayland)
set(Xwayland_VERSION ${PKG_xwayland_VERSION})
pkg_get_variable(Xwayland_HAVE_LISTENFD xwayland have_listenfd)
find_program(Xwayland_EXECUTABLE NAMES Xwayland)
find_package_handle_standard_args(Xwayland
FOUND_VAR Xwayland_FOUND
REQUIRED_VARS Xwayland_EXECUTABLE
VERSION_VAR Xwayland_VERSION
)
mark_as_advanced(
Xwayland_EXECUTABLE
Xwayland_HAVE_LISTENFD
Xwayland_VERSION
)