summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-11-18 09:10:22 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-11-18 09:10:22 +0100
commit615b731783311af2564573a98e59739a281f8f91 (patch)
treee53c7aa105828792c5652ee1fed995f2c904c559 /src
parent72415b534de36888e1a393847ec38544cdbbc3f7 (diff)
CMake+Wayland: check for presence of required software modules
Also, remove hardcoded path to wayland-protocols when CMake version ≥ 3.4
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt14
1 files changed, 9 insertions, 5 deletions
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