dbus-cxx logo

Using pkgconfig

Although this is a bit more in-depth than I planned for a quick start tutorial I thought I'd include this little blurb on using pkgconfig to help with setting your application to use dbus-cxx.
dbus-cxx is distributed with two (at the current time) pkgconfig .pc files named dbus-cxx-1.0.pc and dbus-cxx-glibmm-1.0.pc. If you installed the Fedora dbus-cxx-devel or dbus-cxx-glibmm-devel packages you'll find these files installed in a directory named /pkgconfig under in your architecture's library directory (probably /usr/lib/pkgconfig or /usr/lib64/pkgconfig ).
Using these files with pkgconfig will pull in all the dependencies needed for dbus-cxx. To do this you will need to modify configure.ac (or configure.in ) with the following lines:
 PKG_CHECK_MODULES(PROJECT_DBUSCXX,[dbus-cxx-1.0 >= 0.7.0])
 AC_SUBST(PROJECT_DBUSCXX_LIBS)
 AC_SUBST(PROJECT_DBUSCXX_CFLAGS)
You can then use the symbols PROJECT_DBUSCXX_LIBS and PROJECT_DBUSCXX_CFLAGS in your Makefile.am files.
For example, if you have a application named fooapp your Makefile.am might look like this:
 INCLUDES = $(PROJECT_DBUSCXX_CFLAGS)
 bin_PROGRAMS = fooapp
 fooapp_SOURCES = fooapp.cpp
 fooapp_LDADD = $(PROJECT_DBUSCXX_LIBS)
There are several other aspects to pkgconfig that you will probably want to look into, but since this discussion is already borderline beyond the scope of the quickstart tutorial I'll wrap things up here.

Continue On: Initial Concepts

Go Back: Quick Start Guide to dbus-cxx


Generated on Tue Mar 23 10:01:53 2010 for dbus-cxx by doxygen 1.6.1