Check wayland version in cmake.

Fixed #3579.
This commit is contained in:
Deve 2018-11-17 21:56:23 +01:00
parent c576c45edc
commit 060855c710
2 changed files with 15 additions and 1 deletions

View File

@ -9,6 +9,20 @@
# WAYLAND_LIBRARIES # WAYLAND_LIBRARIES
# Wayland library list # Wayland library list
find_package(PkgConfig REQUIRED)
if(NOT PKGCONFIG_FOUND)
message(FATAL_ERROR "Pkg-config not found.")
endif()
pkg_check_modules(PKG_WAYLAND QUIET wayland-client)
if(PKG_WAYLAND_FOUND)
set(WAYLAND_VERSION ${PKG_WAYLAND_VERSION})
else()
set(WAYLAND_VERSION 0)
endif()
find_path(WAYLAND_CLIENT_INCLUDE_DIR wayland-client.h) find_path(WAYLAND_CLIENT_INCLUDE_DIR wayland-client.h)
find_path(WAYLAND_CURSOR_INCLUDE_DIR wayland-cursor.h) find_path(WAYLAND_CURSOR_INCLUDE_DIR wayland-cursor.h)
find_path(WAYLAND_EGL_INCLUDE_DIR wayland-egl.h) find_path(WAYLAND_EGL_INCLUDE_DIR wayland-egl.h)

View File

@ -52,7 +52,7 @@ if(NOT SERVER_ONLY)
if(ENABLE_WAYLAND_DEVICE) if(ENABLE_WAYLAND_DEVICE)
find_package(Wayland) find_package(Wayland)
if(WAYLAND_FOUND) if(WAYLAND_FOUND AND NOT (WAYLAND_VERSION VERSION_LESS "1.14"))
include_directories(${WAYLAND_INCLUDE_DIR}) include_directories(${WAYLAND_INCLUDE_DIR})
add_definitions(-D_IRR_COMPILE_WITH_WAYLAND_DEVICE_) add_definitions(-D_IRR_COMPILE_WITH_WAYLAND_DEVICE_)
else() else()