|
Boost-Build : |
Subject: Re: [Boost-build] Picking up options from pkg-config
From: Vladimir Prus (ghost_at_[hidden])
Date: 2009-04-01 10:27:00
On Wednesday 01 April 2009 18:05:51 Daniel Lidström wrote:
> > > If you are on Linux, then please use this:
> > >
> > > exe a : a.cpp
> > > : <cflags>`pkg-config --cflags glib-2.0`
> > > : <linkflags>`pkg-config --libs glib-2.0`
> > > ;
> > >
> > > - Volodya
> >
>
> I can't get it to work though:
>
> georog-dev:/home/daniel/projects/test> dir
> total 37K
> drwxr-xr-x 2 daniel daniel 144 2009-04-01 16:02 .
> drwxr-xr-x 10 daniel daniel 768 2009-01-26 09:25 ..
> -rwxr-xr-x 1 daniel daniel 22K 2008-09-08 10:12 a.out
> -rw-r--r-- 1 daniel daniel 108 2009-04-01 16:02 Jamroot
> -rw-r--r-- 1 daniel daniel 2.5K 2008-09-08 10:12 main.cpp
> -rw-r--r-- 1 daniel daniel 422 2008-07-09 16:40 mono.cs
> georog-dev:/home/daniel/projects/test> cat Jamroot
> exe a : a.cpp
> : <cflags>`pkg-config --cflags glib-2.0`
> : <linkflags>`pkg-config --libs glib-2.0`
You should not have ":" on the second line. ":" separates arguments and both
properties above are part of the 'requirements' argument.
> ;
> georog-dev:/home/daniel/projects/test> bjam
> /home/daniel/projects/Vendor/boost-build/milestone12/build/property.jam:320:
> in property.make from module property
> error: '-cflags' is not a valid for property specification
Uhm, try this:
exe a : a.cpp
: <cflags>"`pkg-config --cflags glib-2.0`"
<linkflags>"`pkg-config --libs glib-2.0`"
;
or
exe a : a.cpp
: "<cflags>pkg-config --cflags glib-2.0"
"<linkflags>"`pkg-config --libs glib-2.0"
;
or:
local x = [ SHELL "pkg-config --cflags glib-2.0" ] ;
# Strip newline
local y = [ MATCH "(.*)[\n]" : $(x) ] ;
exe a : a.cpp : <cflags>$(y) ;
As you see, while I know a good deal of possible solutions, I don't
necessary test them all :-)
- Volodya
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk