diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2017-02-10 14:13:25 +0100 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2017-02-10 22:57:40 +0100 |
commit | d89d6b40ba1828d321168b1df11b6df4e8069418 (patch) | |
tree | 0bc38e54607043ecd2bad6ae51be25316c1d542a /cmake/CMakeLists.txt | |
parent | ca75dee7858c95a6366ca30ef9af029d88c49a0f (diff) | |
download | dbus-d89d6b40ba1828d321168b1df11b6df4e8069418.tar.gz |
Add pkgconfig file generating support on unix os to cmake build system.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99752
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'cmake/CMakeLists.txt')
-rw-r--r-- | cmake/CMakeLists.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 2c397d29..c41fb3c7 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -635,3 +635,26 @@ add_custom_target(help-options cmake -LH WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) + +# +# create pkgconfig file +# +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}) + configure_file(../dbus-1.pc.in ${CMAKE_BINARY_DIR}/dbus-1.pc @ONLY) + install(FILES ${CMAKE_BINARY_DIR}/dbus-1.pc DESTINATION lib/pkgconfig) + endif() +endif() |