Add build option FLTK_USE_DBUS to allow build w/o dbus (PR #1252)
Thanks to @lanodan for most of the source code.
This commit is contained in:
parent
85be70efa5
commit
b371c1185c
@ -320,6 +320,7 @@ if(UNIX)
|
||||
endif()
|
||||
unset(FLTK_GRAPHICS_CAIRO CACHE)
|
||||
set(FLTK_GRAPHICS_CAIRO TRUE CACHE BOOL "all drawing to X11 windows uses Cairo")
|
||||
option(FLTK_USE_DBUS "use D-Bus - required to detect the cursor theme" ON)
|
||||
option(FLTK_USE_SYSTEM_LIBDECOR "use libdecor from the system" ON)
|
||||
set(USE_SYSTEM_LIBDECOR 1)
|
||||
unset(FLTK_USE_XRENDER CACHE)
|
||||
|
||||
@ -44,9 +44,12 @@ if(WIN32)
|
||||
elseif(APPLE AND NOT FLTK_BACKEND_X11)
|
||||
list(APPEND FLTK_LDLIBS ${FLTK_COCOA_FRAMEWORKS})
|
||||
elseif(FLTK_USE_WAYLAND)
|
||||
foreach(_lib WLDCURSOR WLDCLIENT XKBCOMMON DBUS)
|
||||
foreach(_lib WLDCURSOR WLDCLIENT XKBCOMMON)
|
||||
list(APPEND FLTK_LDLIBS "${${_lib}_LDFLAGS}")
|
||||
endforeach()
|
||||
if(FLTK_USE_DBUS AND DBUS_FOUND)
|
||||
list(APPEND FLTK_LDLIBS "${DBUS_LDFLAGS}")
|
||||
endif()
|
||||
if(USE_SYSTEM_LIBDECOR)
|
||||
list(APPEND FLTK_LDLIBS ${SYSTEM_LIBDECOR_LDFLAGS})
|
||||
endif(USE_SYSTEM_LIBDECOR)
|
||||
|
||||
@ -411,6 +411,7 @@ if(FLTK_USE_WAYLAND)
|
||||
else()
|
||||
fl_summary("" "Libdecor = Bundled")
|
||||
endif()
|
||||
fl_summary_yn("Use DBUS" DBUS_FOUND)
|
||||
endif(FLTK_USE_WAYLAND)
|
||||
|
||||
message("")
|
||||
|
||||
@ -288,6 +288,9 @@ FLTK_OPTION_SVG - default ON
|
||||
FLTK has a built-in SVG library and can create (write) SVG image files.
|
||||
Turning this option off disables SVG (read and write) support.
|
||||
|
||||
FLTK_USE_DBUS - default ON (Wayland only).
|
||||
Meaningful only under Wayland. Allows FLTK to detect the current cursor theme.
|
||||
|
||||
FLTK_USE_LIBDECOR_GTK - default ON (Wayland only).
|
||||
Meaningful only under Wayland and if FLTK_USE_SYSTEM_LIBDECOR is 'OFF'.
|
||||
Allows to use libdecor's GTK plugin to draw window titlebars. Otherwise
|
||||
|
||||
@ -532,14 +532,16 @@ if(FLTK_USE_X11)
|
||||
endif(FLTK_USE_X11)
|
||||
|
||||
if(FLTK_USE_WAYLAND)
|
||||
pkg_check_modules(DBUS IMPORTED_TARGET dbus-1)
|
||||
set(IDIRS "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
set(CDEFS "_GNU_SOURCE;HAVE_MEMFD_CREATE;HAVE_MKOSTEMP;HAVE_POSIX_FALLOCATE")
|
||||
set(COPTS "-fPIC")
|
||||
if(DBUS_FOUND)
|
||||
set(CDEFS "${CDEFS};HAS_DBUS")
|
||||
set(IDIRS "${IDIRS};${DBUS_INCLUDE_DIRS}")
|
||||
endif(DBUS_FOUND)
|
||||
if(FLTK_USE_DBUS)
|
||||
pkg_check_modules(DBUS IMPORTED_TARGET dbus-1)
|
||||
if(DBUS_FOUND)
|
||||
set(CDEFS "${CDEFS};HAS_DBUS")
|
||||
set(IDIRS "${IDIRS};${DBUS_INCLUDE_DIRS}")
|
||||
endif(DBUS_FOUND)
|
||||
endif(FLTK_USE_DBUS)
|
||||
if(USE_SYSTEM_LIBDECOR)
|
||||
set(CDEFS "${CDEFS};USE_SYSTEM_LIBDECOR;LIBDECOR_PLUGIN_DIR=${LIBDECOR_PLUGIN_DIR}")
|
||||
if(GTK_FOUND)
|
||||
@ -809,7 +811,7 @@ if(UNIX AND FLTK_USE_WAYLAND)
|
||||
|
||||
append_optional_libs("PkgConfig::WLDCURSOR;PkgConfig::WLDCLIENT;PkgConfig::XKBCOMMON")
|
||||
|
||||
if(DBUS_FOUND)
|
||||
if(FLTK_USE_DBUS AND DBUS_FOUND)
|
||||
append_optional_libs(PkgConfig::DBUS)
|
||||
endif()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user