From 2c039595110ec3b5804cb6f12615ba9e77f25c0d Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 22 Mar 2023 10:45:24 +0100 Subject: CMake: check for presence of needed Wayland protocol source files --- src/CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 741d1f5b8..02a6dbd81 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -650,6 +650,22 @@ if (UNIX AND OPTION_USE_WAYLAND) set(PROTOCOLS /usr/share/wayland-protocols) endif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "FreeBSD") endif (NOT (CMAKE_VERSION VERSION_LESS 3.4)) + if (NOT(EXISTS ${PROTOCOLS}/stable/xdg-shell/xdg-shell.xml)) + message(WARNING "Install necessary file ${PROTOCOLS}/stable/xdg-shell/xdg-shell.xml") + endif () + if (NOT(EXISTS ${PROTOCOLS}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml)) + message(WARNING + "Install necessary file ${PROTOCOLS}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml") + endif () + if (NOT(EXISTS ${PROTOCOLS}/unstable/text-input/text-input-unstable-v3.xml)) + message(WARNING + "Install necessary file ${PROTOCOLS}/unstable/text-input/text-input-unstable-v3.xml") + endif () + if (NOT((EXISTS ${PROTOCOLS}/stable/xdg-shell/xdg-shell.xml) AND + (EXISTS ${PROTOCOLS}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml) AND + (EXISTS ${PROTOCOLS}/unstable/text-input/text-input-unstable-v3.xml))) + message(FATAL_ERROR "*** Terminating: one or more required file(s) missing.") + endif () add_custom_command( OUTPUT xdg-shell-protocol.c xdg-shell-client-protocol.h COMMAND wayland-scanner private-code ${PROTOCOLS}/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.c -- cgit v1.2.3