From f58337e4b65dce0303164ef03bfd1d159032b47b Mon Sep 17 00:00:00 2001 From: Antenore Gatta Date: Fri, 23 Apr 2021 16:22:35 +0200 Subject: Make wayland not mandatory during compile time Patch provided by @Dwokfur Fixes: #2469 Signed-off-by: Antenore Gatta --- CMakeLists.txt | 53 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 21 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 17a58b04b..e02d4be53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -376,27 +376,38 @@ if(NOT GTK3_FOUND) endif(NOT GTK3_FOUND) include_directories(${GTK3_INCLUDE_DIRS}) -pkg_check_modules(wayland-client REQUIRED wayland-client) -if(NOT wayland-client_FOUND) - message(FATAL_ERROR "Wayland library not found") -endif(NOT wayland-client_FOUND) - -include_directories(${wayland-client_INCLUDE_DIRS}) - -set(GTK_LIBRARIES - ${GTK3_LIBRARY} - ${GDK3_LIBRARY} - ${GDKPixbuf_LIBRARY} - ${Pango_LIBRARY} - ${Cairo_LIBRARY} - ${GObject_LIBRARY} - ${GLib_LIBRARY} - ${GIO_LIBRARY} - ${Gmodule_LIBRARIES} - ${GMODULE_LIBRARY} - ${wayland-client_LIBRARIES} -) - +pkg_check_modules(wayland-client wayland-client) +if(wayland-client_FOUND) + set(GTK_LIBRARIES + ${GTK3_LIBRARY} + ${GDK3_LIBRARY} + ${GDKPixbuf_LIBRARY} + ${Pango_LIBRARY} + ${Cairo_LIBRARY} + ${GObject_LIBRARY} + ${GLib_LIBRARY} + ${GIO_LIBRARY} + ${Gmodule_LIBRARIES} + ${GMODULE_LIBRARY} + ${wayland-client_LIBRARIES} + ) + include_directories(${wayland-client_INCLUDE_DIRS}) + message(STATUS "Wayland library found.") +else() + set(GTK_LIBRARIES + ${GTK3_LIBRARY} + ${GDK3_LIBRARY} + ${GDKPixbuf_LIBRARY} + ${Pango_LIBRARY} + ${Cairo_LIBRARY} + ${GObject_LIBRARY} + ${GLib_LIBRARY} + ${GIO_LIBRARY} + ${Gmodule_LIBRARIES} + ${GMODULE_LIBRARY} + ) + message(STATUS "Wayland library not found.") +endif() set(CMAKE_THREAD_PREFER_PTHREAD TRUE) find_package(Threads REQUIRED) -- cgit v1.2.3