summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-11-18 09:10:22 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-11-18 09:10:22 +0100
commit615b731783311af2564573a98e59739a281f8f91 (patch)
treee53c7aa105828792c5652ee1fed995f2c904c559 /CMake
parent72415b534de36888e1a393847ec38544cdbbc3f7 (diff)
CMake+Wayland: check for presence of required software modules
Also, remove hardcoded path to wayland-protocols when CMake version ≥ 3.4
Diffstat (limited to 'CMake')
-rw-r--r--CMake/options.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/CMake/options.cmake b/CMake/options.cmake
index b56ed77af..8805263c0 100644
--- a/CMake/options.cmake
+++ b/CMake/options.cmake
@@ -196,6 +196,16 @@ if (UNIX)
list (APPEND FLTK_LDLIBS -lm)
option (OPTION_USE_WAYLAND "support Wayland and X11 backends" OFF)
if (OPTION_USE_WAYLAND)
+ pkg_check_modules(WLDCLIENT wayland-client)
+ pkg_check_modules(WLDCURSOR wayland-cursor)
+ pkg_check_modules(WLDPROTO wayland-protocols)
+ pkg_check_modules(XKBCOMMON xkbcommon)
+ pkg_check_modules(DBUS dbus-1)
+ if (NOT(DBUS_FOUND AND WLDCLIENT_FOUND AND WLDCURSOR_FOUND AND WLDPROTO_FOUND AND XKBCOMMON_FOUND))
+ message (STATUS "Not all software modules 'wayland-client wayland-cursor wayland-protocols xkbcommon dbus-1' are present")
+ message (STATUS "Consequently, building for the Wayland backend is not possible.")
+ message (FATAL_ERROR "*** Aborting ***")
+ endif (NOT(DBUS_FOUND AND WLDCLIENT_FOUND AND WLDCURSOR_FOUND AND WLDPROTO_FOUND AND XKBCOMMON_FOUND))
option (OPTION_WAYLAND_ONLY "support Wayland backend only" OFF)
set (FLTK_USE_WAYLAND 1)
if (NOT OPTION_WAYLAND_ONLY)
@@ -409,6 +419,13 @@ if (HAVE_GL)
endif (HAVE_GL)
if (OPTION_USE_GL)
+ if (OPTION_USE_WAYLAND)
+ pkg_check_modules(WLDEGL wayland-egl)
+ if (NOT WLDEGL_FOUND)
+ message (STATUS "Module 'wayland-egl' is required to build for the Wayland backend.")
+ message (FATAL_ERROR "*** Aborting ***")
+ endif (NOT WLDEGL_FOUND)
+ endif (OPTION_USE_WAYLAND)
if (OPTION_APPLE_X11)
set (OPENGL_FOUND TRUE)
find_library(OPENGL_LIB GL)