[Qbs] How to pass information to custom module via Depends ?

Glenn Coombs glenn.coombs at gmail.com
Wed Feb 15 16:10:07 CET 2017


I've created a task for this here:

    https://bugreports.qt.io/browse/QBS-1105

What is the procedure for creating suggestion issues on JIRA - is it okay
to just create one or is it best to ask questions on this list first ?
Specifically, I'm thinking about the way that PkgConfigProbe uses the PATH
environment to find the pkg-config executable.  When cross compiling it
would be more convenient for it to prepend the toolchain directory to the
PATH so that the target version of pkg-config is used instead of the host
version.  I was able to work around that by setting the executable property
of the PkgConfigProbe item to point to the full path but it would be much
nicer if I didn't have to do that.  Is it worth creating a suggestion issue
in JIRA for this or are there good reasons for not adding this behaviour ?

--
Glenn

On 15 February 2017 at 17:24, Christian Kandeler <christian.kandeler at qt.io>
wrote:

> On 02/15/2017 02:51 AM, Glenn Coombs wrote:
> > I have created a custom module to help wrap a dependency on the
> > Qt5GStreamerUi library.  To use it I add a line like this:
> >
> >     Depends { name: "Qt5GStreamerUi" }
> >
> > to any project that needs to link against Qt5GStreamerUi.  It works fine
> > but I would like to make the module more generic so that I can add a
> > dependency on any library that pkg-config knows about.  I can't work out
> > how to pass the name of the library through to the custom module.  I want
> > to be able to write something like this:
> >
> >     Depends { name: "PkgConfig"; packageName = "Qt5GStreamerUi" }
> >
> > where PkgConfig would be the renamed and modified version of my existing
> > Qt5GStreamerUi module.  Is there a way to do this ?
>
> Depends { name: "PkgConfig" }
> PkgConfig.packageName: "Qt5GStreamerUi"
>
> Of course, this is not a viable general-purpose solution, as it limits
> the PkgConfig module to one package per product.
>
> Making the package name a list has a bunch of other problems. Also, in
> the general case, you'd like to be able to find your library even if
> there is no pkg-config (e.g. have fallback values for the library name
> and look for it in well-known places), so usually you'll want a
> dedicated named module. Perhaps a noninstantiable PkgConfig module item
> would be the right solution; the concrete modules would then derive from
> it.
>
> Either way, pkg-config is important enough to warrant a dedicated JIRA
> task to discuss how to do it right. Feel free to open one.
>
>
> Christian
> _______________________________________________
> Qbs mailing list
> Qbs at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20170215/7a0c4641/attachment.html>


More information about the Qbs mailing list