[QBS] RFC pkgconfig support

Alberto Mardegan mardy at users.sourceforge.net
Tue Aug 21 14:28:42 CEST 2012

On 08/20/2012 08:18 PM, Ruslan Nigmatullin wrote:
> As we have Probes now, why don't simplify syntax to this one:
>  ---pkg-config-module-factory.qbs---
>  ModuleFactory {
>       name: 'pkg-config'
>       ModuleTemplate {
>           Depends { name: "cpp" }
>           Probes.PkgConfigProbe {
>               id: probe
>               // The only issue - where should we modify names? (i.e. qca -> qca2)
>               name: module.name
>           }
>           // condition is false? Don't be sad - just try another one ModuleFactory!
>           condition: probe.found
>           cpp.cFlags: probe.cFlags
>           cpp.cxxFlags: probe.cFlags
>           cpp.linkerFlags: probe.linkerFlags
>           Rule {
>               // transform this to that
>           }
>       }
>  }
> I suppose Probes to be the only place with imperative lookup code. And the only variable we now from outside world is module.name, so why can't we already assign it? Or may be, it's enough just to place such modules to "factories" directory and simplify them just to ModuleTemplate without ModuleFactory? It looks to be as feature-rich as previous syntax

I don't know QBS enough to answer your question but I'll add a couple of
things that I use from pkg-config:

1) Changing the value of a variable defined in the .pc:
  pkg-config --define-variable=prefix=/opt ...

2) Getting the name of a variable defined in the .pc file:
  pkg-config --variable=plugindir mylibrary.pc

at least the first one is something that you'd need to pass to
PkgConfigProbe in addition to "name".


http://blog.mardy.it <- geek in un lingua international!

More information about the Qbs mailing list