libtiff: Merge branch 'pkgconf_abs_path' into 'master'

From 9dec6a620da2e3e0ae96c51c5604a38afc4d2989 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Milo=C5=A1=20Komar=C4=8Devi=C4=87?=
 <miloskomarcevic@aim.com>
Date: Mon, 16 May 2022 15:13:34 +0200
Subject: [PATCH] Handle absolute paths in pkg-config file

---
 cmake/PkgConfig.cmake | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/cmake/PkgConfig.cmake b/cmake/PkgConfig.cmake
index bb139abc..ec4f5383 100644
--- a/cmake/PkgConfig.cmake
+++ b/cmake/PkgConfig.cmake
@@ -48,8 +48,16 @@ endfunction()
 # Generate pkg-config file
 set(prefix "${CMAKE_INSTALL_PREFIX}")
 set(exec_prefix "\${prefix}")
-set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
-set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
+    set(libdir "${CMAKE_INSTALL_LIBDIR}")
+else()
+    set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
+endif()
+if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
+    set(includedir "${CMAKE_INSTALL_INCLUDEDIR}")
+else()
+    set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+endif()
 set_libs_private(tiff_libs_private ${tiff_libs_private_list})
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libtiff-4.pc.in
         ${CMAKE_CURRENT_BINARY_DIR}/libtiff-4.pc @ONLY)