From 095b3113e7438fd0be901e20b40d376bcd8ef860 Mon Sep 17 00:00:00 2001 From: Filipp Andjelo Date: Thu, 11 Oct 2018 14:09:57 +0200 Subject: [PATCH] Use pcfiledir for prefix in pkgconfig file Using absolute paths in the pkg-config file makes it not relocatable and leads to problems, when trying to use it with precompiled cross toolchains. Setting prefix to relative path based on pcfiledir makes it more reliable for such cases. --- googlemock/cmake/gmock.pc.in | 5 +++-- googlemock/cmake/gmock_main.pc.in | 5 +++-- googletest/cmake/gtest.pc.in | 5 +++-- googletest/cmake/gtest_main.pc.in | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/googlemock/cmake/gmock.pc.in b/googlemock/cmake/gmock.pc.in index 2ef0fbca..08e04547 100644 --- a/googlemock/cmake/gmock.pc.in +++ b/googlemock/cmake/gmock.pc.in @@ -1,5 +1,6 @@ -libdir=@CMAKE_INSTALL_FULL_LIBDIR@ -includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ +prefix=${pcfiledir}/../.. +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ Name: gmock Description: GoogleMock (without main() function) diff --git a/googlemock/cmake/gmock_main.pc.in b/googlemock/cmake/gmock_main.pc.in index 04658fe2..b22fe614 100644 --- a/googlemock/cmake/gmock_main.pc.in +++ b/googlemock/cmake/gmock_main.pc.in @@ -1,5 +1,6 @@ -libdir=@CMAKE_INSTALL_FULL_LIBDIR@ -includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ +prefix=${pcfiledir}/../.. +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ Name: gmock_main Description: GoogleMock (with main() function) diff --git a/googletest/cmake/gtest.pc.in b/googletest/cmake/gtest.pc.in index e7967ad5..9aae29e2 100644 --- a/googletest/cmake/gtest.pc.in +++ b/googletest/cmake/gtest.pc.in @@ -1,5 +1,6 @@ -libdir=@CMAKE_INSTALL_FULL_LIBDIR@ -includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ +prefix=${pcfiledir}/../.. +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ Name: gtest Description: GoogleTest (without main() function) diff --git a/googletest/cmake/gtest_main.pc.in b/googletest/cmake/gtest_main.pc.in index fe25d9c7..915f2973 100644 --- a/googletest/cmake/gtest_main.pc.in +++ b/googletest/cmake/gtest_main.pc.in @@ -1,5 +1,6 @@ -libdir=@CMAKE_INSTALL_FULL_LIBDIR@ -includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ +prefix=${pcfiledir}/../.. +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ Name: gtest_main Description: GoogleTest (with main() function)