libtiff: CMake: Fix TIFF_INCLUDE_DIRS

From f8498e2a9a68807ad64d04bf0f8dbf6826174812 Mon Sep 17 00:00:00 2001
From: Julien Schueller <[EMAIL REDACTED]>
Date: Wed, 11 Oct 2023 14:28:18 +0000
Subject: [PATCH] CMake: Fix TIFF_INCLUDE_DIRS

---
 cmake/TiffConfig.cmake.in | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/cmake/TiffConfig.cmake.in b/cmake/TiffConfig.cmake.in
index fad966cf..d59dc58c 100644
--- a/cmake/TiffConfig.cmake.in
+++ b/cmake/TiffConfig.cmake.in
@@ -11,8 +11,7 @@ function(set_variable_from_rel_or_absolute_path var root rel_or_abs_path)
 endfunction()
 
 # Tell the user project where to find our headers and libraries
-get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" ABSOLUTE)
-get_filename_component(_DIR "${_DIR}" DIRECTORY)
+get_filename_component(_DIR "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
 get_filename_component(_ROOT "${_DIR}/@PROJECT_ROOT_DIR@" ABSOLUTE)
 # Use _ROOT as prefix here for the possibility of relocation after installation.
 set_variable_from_rel_or_absolute_path("TIFF_INCLUDE_DIR" "${_ROOT}" "@CMAKE_INSTALL_INCLUDEDIR@")
@@ -21,7 +20,7 @@ set(TIFF_INCLUDE_DIRS ${TIFF_INCLUDE_DIR})
 set(TIFF_LIBRARIES TIFF::tiff)
 
 if(NOT TARGET TIFF::tiff)
-    include("${_DIR}/TiffTargets.cmake")
+    include("${CMAKE_CURRENT_LIST_DIR}/TiffTargets.cmake")
 endif()
 
 unset (_ROOT)