# Use pkg-config to get the directories
FIND_PACKAGE(PkgConfig)

PKG_CHECK_MODULES(PKG_WAYLAND QUIET wayland-client)

FIND_PATH(WAYLAND_CLIENT_INCLUDE_DIR  NAMES wayland-client.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})

FIND_LIBRARY(WAYLAND_CLIENT_LIBRARIES NAMES wayland-client   HINTS ${PKG_WAYLAND_LIBRARY_DIRS})

set(WAYLAND_INCLUDE_DIR ${WAYLAND_CLIENT_INCLUDE_DIR} ${WAYLAND_SERVER_INCLUDE_DIR} ${WAYLAND_EGL_INCLUDE_DIR} ${WAYLAND_CURSOR_INCLUDE_DIR})

if(WAYLAND_CLIENT_INCLUDE_DIR)
    set(WAYLAND_CLIENT_FOUND 1)
    message(STATUS "Wayland Client is detected")
endif()

