File 0001-Use-absolute-CMAKE_INSTALL_FULL_LIBDIR-for-libdir-in.patch of Package openexr

From e1084440d543f3045038cc4e5fdc0a67eabf06d6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Mon, 10 Feb 2020 18:37:32 +0100
Subject: [PATCH] Use absolute CMAKE_INSTALL_FULL_LIBDIR for libdir in
 pkgconfig files

According to cmake GNUInstallDirs documentation, CMAKE_INSTALL_LIBDIR
may be either absolute or relative to CMAKE_INSTALL_PREFIX. Use
CMAKE_INSTALL_FULL_LIBDIR, which is always the full absolute path.

Remove unused exec_prefix variable.

Fixes https://github.com/AcademySoftwareFoundation/openexr/issues/595
---
 IlmBase/IlmBase.pc.in           | 1 -
 IlmBase/config/CMakeLists.txt   | 4 ++--
 OpenEXR/OpenEXR.pc.in           | 1 -
 OpenEXR/config/CMakeLists.txt   | 5 ++---
 PyIlmBase/config/CMakeLists.txt | 4 ++--
 5 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/IlmBase/IlmBase.pc.in b/IlmBase/IlmBase.pc.in
index 45fc4de..1edd055 100644
--- a/IlmBase/IlmBase.pc.in
+++ b/IlmBase/IlmBase.pc.in
@@ -4,7 +4,6 @@
 ##
 
 prefix=@prefix@
-exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
 libsuffix=@LIB_SUFFIX_DASH@
diff --git a/IlmBase/config/CMakeLists.txt b/IlmBase/config/CMakeLists.txt
index d9c5ae4..fc161b0 100644
--- a/IlmBase/config/CMakeLists.txt
+++ b/IlmBase/config/CMakeLists.txt
@@ -76,8 +76,8 @@ if(ILMBASE_INSTALL_PKG_CONFIG)
   function(ilmbase_pkg_config_help pcinfile)
     set(prefix ${CMAKE_INSTALL_PREFIX})
     set(exec_prefix "\${prefix}")
-    set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
-    set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+    set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
+    set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
     set(LIB_SUFFIX_DASH ${ILMBASE_LIB_SUFFIX})
     if(TARGET Threads::Threads)
       # hrm, can't use properties as they end up as generator expressions
diff --git a/OpenEXR/OpenEXR.pc.in b/OpenEXR/OpenEXR.pc.in
index cf72f88..4df6035 100644
--- a/OpenEXR/OpenEXR.pc.in
+++ b/OpenEXR/OpenEXR.pc.in
@@ -4,7 +4,6 @@
 ##
 
 prefix=@prefix@
-exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
 OpenEXR_includedir=@includedir@/OpenEXR
diff --git a/OpenEXR/config/CMakeLists.txt b/OpenEXR/config/CMakeLists.txt
index b52ad0d..59f4916 100644
--- a/OpenEXR/config/CMakeLists.txt
+++ b/OpenEXR/config/CMakeLists.txt
@@ -72,9 +72,8 @@ if(OPENEXR_INSTALL_PKG_CONFIG)
   # use a helper function to avoid variable pollution, but pretty simple
   function(openexr_pkg_config_help pcinfile)
     set(prefix ${CMAKE_INSTALL_PREFIX})
-    set(exec_prefix "\${prefix}")
-    set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
-    set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+    set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
+    set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
     set(LIB_SUFFIX_DASH ${OPENEXR_LIB_SUFFIX})
     if(TARGET Threads::Threads)
       # hrm, can't use properties as they end up as generator expressions
diff --git a/PyIlmBase/config/CMakeLists.txt b/PyIlmBase/config/CMakeLists.txt
index 1872c89..a971723 100644
--- a/PyIlmBase/config/CMakeLists.txt
+++ b/PyIlmBase/config/CMakeLists.txt
@@ -16,8 +16,8 @@ if(PYILMBASE_INSTALL_PKG_CONFIG)
   function(pyilmbase_pkg_config_help pcinfile)
     set(prefix ${CMAKE_INSTALL_PREFIX})
     set(exec_prefix ${CMAKE_INSTALL_BINDIR})
-    set(libdir ${CMAKE_INSTALL_LIBDIR})
-    set(includedir ${CMAKE_INSTALL_INCLUDEDIR})
+    set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
+    set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
     set(LIB_SUFFIX_DASH ${OPENEXR_LIB_SUFFIX})
     string(REPLACE ".in" "" pcout ${pcinfile})
     configure_file(${pcinfile} ${CMAKE_CURRENT_BINARY_DIR}/${pcout} @ONLY)
-- 
2.27.0