diff --git a/debian/patches/0005-Make-FindFLTK-safe-to-include-multiple-times.patch b/debian/patches/0005-Make-FindFLTK-safe-to-include-multiple-times.patch new file mode 100644 index 000000000..2f0b4287a --- /dev/null +++ b/debian/patches/0005-Make-FindFLTK-safe-to-include-multiple-times.patch @@ -0,0 +1,38 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= +Date: Mon, 18 Oct 2021 16:45:01 +0200 +Subject: Make FindFLTK safe to include multiple times + +Forwarded: not-needed + +This is a backport of commit 51fd21736b10e2fa04382c5aa71f2044d31e362f +from the 3.22.x milestone. +--- + Modules/FindFLTK.cmake | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake +index bab7256..d54d2f6 100644 +--- a/Modules/FindFLTK.cmake ++++ b/Modules/FindFLTK.cmake +@@ -152,13 +152,17 @@ if(NOT FLTK_DIR) + endif() + + # Check if FLTK was built using CMake +-if(EXISTS ${FLTK_DIR}/FLTKConfig.cmake) +- set(FLTK_BUILT_WITH_CMAKE 1) +-endif() ++foreach(fltk_include IN LISTS FLTK_DIR) ++ if(EXISTS "${fltk_include}/FLTKConfig.cmake") ++ set(FLTK_BUILT_WITH_CMAKE 1) ++ set(FLTK_CMAKE_PATH "${fltk_include}/FLTKConfig.cmake") ++ break() ++ endif() ++endforeach() + + if(FLTK_BUILT_WITH_CMAKE) + set(FLTK_FOUND 1) +- include(${FLTK_DIR}/FLTKConfig.cmake) ++ include("${FLTK_CMAKE_PATH}") + + # Fluid + if(FLUID_COMMAND) diff --git a/debian/patches/series b/debian/patches/series index c9e4823ee..ab032988e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,4 @@ 0002-Prefer-Debian-default-version-of-Python.patch 0003-Fix-RunCMake.CPack_DEB.EXTRA-on-Debian-non-Linux-OSe.patch 0004-Fix-misinterpretation-of-Debian-Policy-on-LIBEXECDIR.patch +0005-Make-FindFLTK-safe-to-include-multiple-times.patch