From 84325948106ba2d6217bda694e77420d424389e7 Mon Sep 17 00:00:00 2001
From: Slávek Banko <slavek.banko@axis.cz>
Date: Mon, 19 Oct 2026 18:14:30 +0200
Subject: Prefer to use pkg-config to detect tiff library. This solves FTBFS
 with tiff library >= 4.7.0.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
---
 ConfigureChecks.cmake                     | 5 ++++-
 kipi-plugins/acquireimages/CMakeLists.txt | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index f75f45c0..70c6f0c1 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -117,7 +117,10 @@ endif( )
 ##### check for libtiff
 
 if( BUILD_ACQUIREIMAGES OR BUILD_RAWCONVERTER )
-  find_package( TIFF )
+  pkg_search_module( TIFF libtiff-4 )
+  if( NOT TIFF_FOUND )
+    find_package( TIFF )
+  endif( NOT TIFF_FOUND )
   if( NOT TIFF_FOUND )
     tde_message_fatal( "libtiff support was requested, but was not found on your system" )
   endif( )
diff --git a/kipi-plugins/acquireimages/CMakeLists.txt b/kipi-plugins/acquireimages/CMakeLists.txt
index cd500b3d..119c4723 100644
--- a/kipi-plugins/acquireimages/CMakeLists.txt
+++ b/kipi-plugins/acquireimages/CMakeLists.txt
@@ -4,6 +4,10 @@ include_directories(
   ${TIFF_INCLUDE_DIRS}
 )
 
+link_directories(
+  ${TIFF_LIBRARY_DIRS}
+)
+
 
 ##### kipiplugin_acquireimages (module)
 
-- 
cgit v1.2.3

