[Qbs] Grouping files

Dan Pat dannix84 at gmail.com
Wed Mar 24 09:39:28 CET 2021


Spot on. Thanks a lot!

On Wed, 24 Mar 2021 at 13:31, Jochen Ulrich <jochen.ulrich at bee360.com>
wrote:

> How about setting the `excludeFiles` conditionally?
> So something like this:
>
>
>
> Group {
>
>     files: "*.cpp"
>
>     prefix: "**/"
>
>     excludeFiles: qbs.targetOS.contains("linux") ? "*_windows.cpp" :
> "*_linux.cpp"
>
> }
>
>
>
> Not sure if this works, though.
>
>
>
> Best
>
> Jochen
>
>
>
> *Von: *Qbs <qbs-bounces at qt-project.org> im Auftrag von Dan Pat <
> dannix84 at gmail.com>
> *Datum: *Mittwoch, 24. März 2021 um 08:05
> *An: *qbs <qbs at qt-project.org>
> *Betreff: *[Qbs] Grouping files
>
> Hi. I have a complex directory structure where cpp/h files reside. To add
> these files to the project, I would normally create a Group and  specify
> the top level directory using a wild card '**'  - saves me a lot of typing.
> Now, I am faced with a task of conditionally selecting implementation files
> for different platform targets, that is  files '*_linux.cpp' must be chosen
> for the linux target and '*_windows.cpp' - for the windows target. There
> are just a couple of such places, deep down the directory hierarchy, where
> such separation is needed, not that this is a regular thing.  I don't know
> of any way to exclude files using a wildcard, I guess that's what the
> "excludeFiles" property is for. But using this property means I have to
> create another Group to deal with implementation files which will be shown
> separately in the project tree view. If what you want is a single view of
> the directory structure with the appropriate implementation files shown
> (and it's what I want) you need to abandon the wildcard description (to a
> degree depending on the actual directory structure and location of
> implementation files) and list some directories manually (a lot, in may
> case). So, do I accept it and live with it? Or, maybe there's an approach I
> am missing?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20210324/cac90574/attachment.html>


More information about the Qbs mailing list