From 14dcf1bccfa17dbc1f29751110d535eb2b4d45e3 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Sun, 12 Feb 2017 10:43:39 +0100 Subject: [PATCH] cmake: create relocatable dbus-1.pc file Relocatable pkgconfig files are required to use installed packages from a non standard location. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99721 --- cmake/CMakeLists.txt | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index aafaf5e..f1ae4a8 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -634,17 +634,15 @@ if(UNIX) set(PLATFORM_LIBS pthread ${LIBRT}) include(FindPkgConfig QUIET) if(PKG_CONFIG_FOUND) - # convert lists of link libraries into -lstdc++ -lm etc.. - foreach(LIB ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS}) - set(LIBDBUS_LIBS "${LIBDBUS_LIBS} -l${LIB}") - endforeach() - set(bindir ${EXPANDED_BINDIR}) - set(libdir ${EXPANDED_LIBDIR}) - set(includedir ${EXPANDED_INCLUDEDIR}) - set(sysconfdir ${EXPANDED_SYSCONFDIR}) - set(datadir ${EXPANDED_DATADIR}) - set(datarootdir ${EXPANDED_DATADIR}) - set(dbus_daemondir ${DBUS_DAEMONDIR}) + set(prefix "\${pcfiledir}/../..") + set(exec_prefix "\${prefix}") + set(bindir "\${prefix}/${CMAKE_INSTALL_BINDIR}") + set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}") + set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") + set(sysconfdir "\${prefix}/${CMAKE_INSTALL_SYSCONFDIR}") + set(datadir "\${prefix}/${CMAKE_INSTALL_DATADIR}") + set(datarootdir "\${prefix}/${CMAKE_INSTALL_DATADIR}") + set(dbus_daemondir "\${prefix}/${CMAKE_INSTALL_BINDIR}") configure_file(../dbus-1.pc.in ${CMAKE_BINARY_DIR}/dbus-1.pc @ONLY) install(FILES ${CMAKE_BINARY_DIR}/dbus-1.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() -- 2.6.6