summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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