How to use fbuild with pkg-config and with QT

24 views
Skip to first unread message

axeoth

unread,
Jun 19, 2012, 4:59:15 AM6/19/12
to fbuild
Hi all,

I would like to use fbuild with pkg-config tool, ie. being able to do
something like in SCons:

http://www.scons.org/wiki/UsingPkgConfig

specifically:

env.ParseConfig('pkg-config --cflags --libs gtk+-2.0')

I understand that, for now, there is no dedicated function in fbuild
to parse the output of pkg-config?

OTOH, how do I use fbuild with QT?

Thank you very much!

rym...@gmail.com

unread,
Jul 5, 2015, 6:11:43 PM7/5/15
to fbu...@googlegroups.com
3 years into the future... :O

I added a simple pkg-config builder in commit e632660f67482f56fee0ebd069cc248a6bcd9836. That means that your example would be something like this:

from fbuild.builders.pkg_config import PkgConfig
from fbuild.builders.c import guess_static

def build(ctx):
    gtk = PkgConfig(ctx, 'gtk+-2.0') # Get the Gtk+ 2 package
    c = guess_static(ctx, flags=gtk.cflags, external_libs=gtk.libs)
    # etc.

As for Qt: I don't use it, so this may be wrong, but you can use pkg-config as shown above to get the proper flags and implement some sort of moc builder following the implementation of builders/bison.py.
Reply all
Reply to author
Forward
0 new messages