From 6da820485e8d6dbb1d5633eab78cea223e2efd4a Mon Sep 17 00:00:00 2001 From: Xeonacid Date: Tue, 1 Sep 2026 15:43:32 +0200 Subject: [PATCH] Add Cairo include directories for FLTK 1.4 widget opcodes FLTK 1.4 built with Cairo support (FLTK_HAVE_CAIRO) includes from via Fl_Cairo.H. cairo.h lives under a subdirectory such as /usr/include/cairo, which CMake's module-mode FindFLTK does not add to the include path. Without those directories, building the widgets and virtual keyboard plugins fails with: fatal error: cairo.h: No such file or directory Look up cairo.h (PATH_SUFFIXES cairo) and, when found, add its include directory to both FLTK plugin targets. This is a no-op for FLTK 1.3 builds that do not pull in Cairo headers. --- 6.x/src/widgets/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/6.x/src/widgets/CMakeLists.txt b/6.x/src/widgets/CMakeLists.txt index 7d441cfb..4dda233a 100644 --- a/6.x/src/widgets/CMakeLists.txt +++ b/6.x/src/widgets/CMakeLists.txt @@ -8,6 +8,8 @@ else() find_package(FLTK) endif() +find_path(CAIRO_INCLUDE_DIR cairo.h PATH_SUFFIXES cairo) + check_deps(USE_FLTK FLTK_FOUND) if(USE_FLTK) @@ -48,3 +50,8 @@ if(USE_FLTK) ) endif() endif() + +if(USE_FLTK AND CAIRO_INCLUDE_DIR) + target_include_directories(widgets PRIVATE ${CAIRO_INCLUDE_DIR}) + target_include_directories(virtual PRIVATE ${CAIRO_INCLUDE_DIR}) +endif()