From 615b731783311af2564573a98e59739a281f8f91 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:10:22 +0100 Subject: CMake+Wayland: check for presence of required software modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also, remove hardcoded path to wayland-protocols when CMake version ≥ 3.4 --- src/CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index edb3f54c0..b8b773d53 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -624,11 +624,15 @@ if (USE_XFT) endif (USE_XFT) if (UNIX AND OPTION_USE_WAYLAND) - if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "FreeBSD") - set(PROTOCOLS /usr/local/share/wayland-protocols) - else () - set(PROTOCOLS /usr/share/wayland-protocols) - endif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "FreeBSD") + if (NOT (CMAKE_VERSION VERSION_LESS 3.4)) + pkg_get_variable(PROTOCOLS wayland-protocols pkgdatadir) # requires cmake 3.4 + else() + if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "FreeBSD") + set(PROTOCOLS /usr/local/share/wayland-protocols) + else () + set(PROTOCOLS /usr/share/wayland-protocols) + endif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "FreeBSD") + endif (NOT (CMAKE_VERSION VERSION_LESS 3.4)) 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