diff --git a/cmake/FindWayland.cmake b/cmake/FindWayland.cmake index 17d200da6..6adad03e9 100644 --- a/cmake/FindWayland.cmake +++ b/cmake/FindWayland.cmake @@ -9,6 +9,20 @@ # WAYLAND_LIBRARIES # 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_CURSOR_INCLUDE_DIR wayland-cursor.h) find_path(WAYLAND_EGL_INCLUDE_DIR wayland-egl.h) diff --git a/lib/irrlicht/CMakeLists.txt b/lib/irrlicht/CMakeLists.txt index c41f69efa..6317ccb76 100644 --- a/lib/irrlicht/CMakeLists.txt +++ b/lib/irrlicht/CMakeLists.txt @@ -52,7 +52,7 @@ if(NOT SERVER_ONLY) if(ENABLE_WAYLAND_DEVICE) find_package(Wayland) - if(WAYLAND_FOUND) + if(WAYLAND_FOUND AND NOT (WAYLAND_VERSION VERSION_LESS "1.14")) include_directories(${WAYLAND_INCLUDE_DIR}) add_definitions(-D_IRR_COMPILE_WITH_WAYLAND_DEVICE_) else()