2022-11-30 12:30:20 +00:00
|
|
|
set(WAYLAND_FOUND FALSE)
|
|
|
|
|
|
|
|
find_path(_WAYLAND_CLIENT_INCLUDE_DIR NAMES wayland-client.h)
|
|
|
|
find_library(_WAYLAND_CLIENT_LIBRARY NAMES wayland-client libwayland-client)
|
2023-10-02 15:27:40 +00:00
|
|
|
find_program(_WAYLAND_SCANNER wayland-scanner)
|
|
|
|
find_file(_WAYLAND_XDG_SHELL_PROTO xdg-shell.xml HINTS /usr/share/wayland-protocols/stable/xdg-shell)
|
2022-11-30 12:30:20 +00:00
|
|
|
|
2023-10-02 15:27:40 +00:00
|
|
|
if (_WAYLAND_CLIENT_INCLUDE_DIR AND _WAYLAND_SCANNER AND _WAYLAND_CLIENT_LIBRARY)
|
2022-11-30 12:30:20 +00:00
|
|
|
set(WAYLAND_FOUND TRUE)
|
2023-10-02 15:27:40 +00:00
|
|
|
set(WAYLAND_LIBRARIES ${_WAYLAND_CLIENT_LIBRARY} wayland-egl)
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT xdg-shell-client-procotol.h
|
|
|
|
xdg-shell-protocol.c
|
|
|
|
COMMAND ${_WAYLAND_SCANNER} client-header < ${_WAYLAND_XDG_SHELL_PROTO} > xdg-shell-client-protocol.h
|
|
|
|
COMMAND ${_WAYLAND_SCANNER} private-code < ${_WAYLAND_XDG_SHELL_PROTO} > xdg-shell-protocol.c
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
|
|
|
|
|
|
endif()
|