1

I am new to Qbs and trying to configure a BareMetal Project using Qbs build system. Well, Currently it looks like one has to add manually all the Subfolders using Group Property.

This is a lot of work for huge projects and one has to update Qbs file when new files or subfolders are added.

I just wanted to know if it is possible to first get all the subfolders from a rootfolder, then iterate over each of the subfolders and apply Group Property on each of them, at the same time applying exceptions such as excludefile etc

any help on this will be much appreciated.

Jake Petroules
  • 23,472
  • 35
  • 144
  • 225

1 Answers1

1

See the second code example in http://doc.qt.io/qbs/group-item.html

When specifying files, you can use the wildcards "*", "?" and "[]", which have their usual meaning. By default, matching files are only picked up directly from the parent directory, but you can tell Qbs to consider the whole directory tree. It is also possible to exclude certain files from the list. The pattern ** used in a pathname expansion context will match all files and zero or more directories and subdirectories. For example:

Group {
    name: "Word processing documents"
    files: ["*.doc", "*.rtf"]
    prefix: "**/"
    qbs.install: true
    qbs.installDir: "share"
    excludeFiles: "do_not_install_this_file.*"
}
Jake Petroules
  • 23,472
  • 35
  • 144
  • 225
  • Hi Jake, Thanks for your reply.That works. Well, I have got one more question,Generally in Qmake projects one can create solutions with multiple projects.One can select Current Project by setting "Set active Project" Property. Well in QBS, is there a way to do so, I mean I want to open single QBS file, which is supposed to contain definitions of multiple Projects and then one can select one of the projects as Active project by right clicking and selecting it.Currently I am able to do subprojects in project which doesnt allow set active project property on right click.Thanks in advance – Sirsikar Abhishek Dec 26 '16 at 23:44
  • No, you cannot do that. Nested Qbs Projects are similar to qmake SUBDIRS projects. You can always open multiple Qbs projects just like you can multiple qmake projects, however. – Jake Petroules Dec 27 '16 at 17:25