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@