diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-12-01 14:43:32 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-12-02 09:28:08 +0100 |
| commit | f72748bb4563c07322846ae92cc9c02c0b448e5b (patch) | |
| tree | f1810fa604d181fc018249eb3fd0a0742650548d /CMake | |
| parent | 96730f80cbc3b2d5aec2967a61f16bb2f02853e6 (diff) | |
Wayland: make OPTION_USE_SYSTEM_LIBDECOR ON by default
This commit makes the default FLTK build setting use libdecor
as packaged in Linux when the build system contains packages
libdecor-0-dev and libdecor-0-plugin-1-gtk in version ≥ 0.2.0.
Otherwise, FLTK uses the bundled version of libdecor.
This includes situations where package libdecor-0-dev is
present in an earlier version.
Diffstat (limited to 'CMake')
| -rw-r--r-- | CMake/options.cmake | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/CMake/options.cmake b/CMake/options.cmake index 5dad843d0..b5150dee2 100644 --- a/CMake/options.cmake +++ b/CMake/options.cmake @@ -258,7 +258,7 @@ if (UNIX) endif (X11_FOUND) unset (OPTION_USE_CAIRO CACHE) set (OPTION_USE_CAIRO TRUE CACHE BOOL "all drawing to X11 windows uses Cairo") - option (OPTION_USE_SYSTEM_LIBDECOR "use libdecor from the system" OFF) + option (OPTION_USE_SYSTEM_LIBDECOR "use libdecor from the system" ON) unset (OPTION_USE_XRENDER CACHE) unset (OPTION_USE_XINERAMA CACHE) unset (OPTION_USE_XFT CACHE) @@ -293,13 +293,25 @@ if (UNIX) unset (OPTION_USE_PANGO CACHE) set (OPTION_USE_PANGO TRUE CACHE BOOL "use lib Pango") if (OPTION_USE_SYSTEM_LIBDECOR) - pkg_check_modules(SYSTEM_LIBDECOR libdecor-0) + pkg_check_modules(SYSTEM_LIBDECOR libdecor-0>=0.2.0) if (NOT SYSTEM_LIBDECOR_FOUND) set (OPTION_USE_SYSTEM_LIBDECOR OFF) + else () + pkg_get_variable(LIBDECOR_LIBDIR libdecor-0 libdir) + set (LIBDECOR_PLUGIN_DIR ${LIBDECOR_LIBDIR}/libdecor/plugins-1) + if (EXISTS ${LIBDECOR_PLUGIN_DIR} AND IS_DIRECTORY ${LIBDECOR_PLUGIN_DIR}) + set (LIBDECOR_PLUGIN_DIR "\\\"${LIBDECOR_PLUGIN_DIR}\\\" " ) + else () + set (OPTION_USE_SYSTEM_LIBDECOR OFF) + endif () endif (NOT SYSTEM_LIBDECOR_FOUND) endif (OPTION_USE_SYSTEM_LIBDECOR) - option (OPTION_ALLOW_GTK_PLUGIN "Allow to use libdecor's GTK plugin" ON) + if (OPTION_USE_SYSTEM_LIBDECOR) + set (OPTION_ALLOW_GTK_PLUGIN ON) + else () + option (OPTION_ALLOW_GTK_PLUGIN "Allow to use libdecor's GTK plugin" ON) + endif (OPTION_USE_SYSTEM_LIBDECOR) if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "FreeBSD") CHECK_INCLUDE_FILE (linux/input.h LINUX_INPUT_H) @@ -856,7 +868,7 @@ if ((X11_Xft_FOUND OR NOT USE_PANGOXFT) AND OPTION_USE_PANGO) endif ((X11_Xft_FOUND OR NOT USE_PANGOXFT) AND OPTION_USE_PANGO) -if (OPTION_USE_WAYLAND AND NOT OPTION_USE_SYSTEM_LIBDECOR) +if (OPTION_USE_WAYLAND) # Note: Disable OPTION_ALLOW_GTK_PLUGIN to get cairo titlebars rather than GTK if (OPTION_ALLOW_GTK_PLUGIN) @@ -869,7 +881,7 @@ if (OPTION_USE_WAYLAND AND NOT OPTION_USE_SYSTEM_LIBDECOR) endif (GTK_FOUND) endif (OPTION_ALLOW_GTK_PLUGIN) -endif (OPTION_USE_WAYLAND AND NOT OPTION_USE_SYSTEM_LIBDECOR) +endif (OPTION_USE_WAYLAND) if (OPTION_USE_XFT) set (USE_XFT X11_Xft_FOUND) |
