From 1f6f862e00511490c02a884d727d7e947223b7d8 Mon Sep 17 00:00:00 2001 From: Sean McGrath Date: Tue, 19 Nov 2024 23:43:18 +0000 Subject: [PATCH] Avoid embedding the absolute install prefix in the artifacts Signed-off-by: Sean McGrath Signed-off-by: Sean McGrath --- CMakeLists.txt | 2 ++ console_bridge.pc.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ba726a..c9ec0d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,8 @@ install(FILES "${CMAKE_BINARY_DIR}/${cmake_conf_version_file}" DESTINATION ${CMAKE_CONFIG_INSTALL_DIR} COMPONENT cmake) +string(REGEX REPLACE "[^/]+" ".." RELATIVE_PATH_LIBDIR_TO_PREFIX "${CMAKE_INSTALL_LIBDIR}") + set(PKG_DESC "Console Bridge") set(PKG_CB_LIBS "-l${PROJECT_NAME}") set(pkg_conf_file "console_bridge.pc") diff --git a/console_bridge.pc.in b/console_bridge.pc.in index 85e30b0..a080501 100644 --- a/console_bridge.pc.in +++ b/console_bridge.pc.in @@ -1,5 +1,5 @@ # This file was generated by CMake for @PROJECT_NAME@ -prefix=@CMAKE_INSTALL_PREFIX@ +prefix=${pcfiledir}/../@RELATIVE_PATH_LIBDIR_TO_PREFIX@ exec_prefix=${prefix} libdir=@CMAKE_INSTALL_FULL_LIBDIR@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@