diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 17:06:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 17:06:32 +0000 |
commit | 2dad5357405ad33cfa792f04b3ab62a5d188841e (patch) | |
tree | b8f8893942060fe3cfb04ac374cda96fdfc8f453 /cmake/FindWayland.cmake | |
parent | Initial commit. (diff) | |
download | remmina-2dad5357405ad33cfa792f04b3ab62a5d188841e.tar.xz remmina-2dad5357405ad33cfa792f04b3ab62a5d188841e.zip |
Adding upstream version 1.4.34+dfsg.upstream/1.4.34+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/FindWayland.cmake')
-rw-r--r-- | cmake/FindWayland.cmake | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/cmake/FindWayland.cmake b/cmake/FindWayland.cmake new file mode 100644 index 0000000..e351733 --- /dev/null +++ b/cmake/FindWayland.cmake @@ -0,0 +1,69 @@ +# - Finds Wayland +# Find the Wayland libraries that are needed for UWAC +# +# This module defines the following variables: +# WAYLAND_FOUND - true if UWAC has been found +# WAYLAND_LIBS - Set to the full path to wayland client libraries +# WAYLAND_INCLUDE_DIR - Set to the include directories for wayland +# XKBCOMMON_LIBS - Set to the full path to xkbcommon libraries +# XKBCOMMON_INCLUDE_DIR - Set to the include directories for xkbcommon +# + +#============================================================================= +# Copyright 2015 David Fort <contact@hardening-consulting.com> +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============================================================================= + +include(FindPkgConfig) + +if(PKG_CONFIG_FOUND) + pkg_check_modules(WAYLAND_SCANNER_PC wayland-scanner) + pkg_check_modules(WAYLAND_CLIENT_PC wayland-client) + pkg_check_modules(WAYLAND_CURSOR_PC wayland-cursor) + pkg_check_modules(XKBCOMMON_PC xkbcommon) +endif() + +find_program(WAYLAND_SCANNER wayland-scanner + HINTS "${WAYLAND_SCANNER_PC_PREFIX}/bin" +) + +find_path(WAYLAND_INCLUDE_DIR wayland-client.h + HINTS ${WAYLAND_CLIENT_PC_INCLUDE_DIRS} +) + +find_library(WAYLAND_CLIENT_LIB + NAMES "wayland-client" + HINTS "${WAYLAND_CLIENT_PC_LIBRARY_DIRS}" +) + +find_library(WAYLAND_CURSOR_LIB + NAMES "wayland-cursor" + HINTS "${WAYLAND_CURSOR_PC_LIBRARY_DIRS}" +) + +if (WAYLAND_CLIENT_LIB AND WAYLAND_CURSOR_LIB) + list(APPEND WAYLAND_LIBS ${WAYLAND_CLIENT_LIB} ${WAYLAND_CURSOR_LIB}) +endif (WAYLAND_CLIENT_LIB AND WAYLAND_CURSOR_LIB) + +find_path(XKBCOMMON_INCLUDE_DIR xkbcommon/xkbcommon.h + HINTS ${XKBCOMMON_PC_INCLUDE_DIRS} +) + +find_library(XKBCOMMON_LIBS + NAMES xkbcommon + HINTS "${XKBCOMMON_PC_LIBRARY_DIRS}" +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_SCANNER WAYLAND_INCLUDE_DIR WAYLAND_LIBS XKBCOMMON_INCLUDE_DIR XKBCOMMON_LIBS) |