From d874a3ce5ad741ea61f42953c779d50ae93b66d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= 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 | 5 ++--- OpenEXR/OpenEXR.pc.in | 1 - OpenEXR/config/CMakeLists.txt | 5 ++--- 4 files changed, 4 insertions(+), 8 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 508176a..e533987 100644 --- a/IlmBase/config/CMakeLists.txt +++ b/IlmBase/config/CMakeLists.txt @@ -71,9 +71,8 @@ if(ILMBASE_INSTALL_PKG_CONFIG) # use a helper function to avoid variable pollution, but pretty simple function(ilmbase_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 ${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 1ef829a..e068d2f 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 ${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}) if(TARGET Threads::Threads) # hrm, can't use properties as they end up as generator expressions -- 2.25.0