[Qbs] Recursive file installation and preserve the folder structure

Epting, Thomas thomas.epting at stryker.com
Sat Oct 21 10:55:35 CEST 2017


Hi Ben,

You have to use the qbs.installSourceBase property in such cases.

Group {
    qbs.install: true
    qbs.installDir: "path/to/target/target"
    qbs.installSourceBase: "path/to/source"
    files : [ "path/to/source/**" ]
}

Best regards,
Thomas

Von: Qbs [mailto:qbs-bounces+thomas.epting=stryker.com at qt-project.org] Im Auftrag von Ben Lau
Gesendet: Samstag, 21. Oktober 2017 10:23
An: qbs at qt-project.org
Betreff: [Qbs] Recursive file installation and preserve the folder structure

Hello,

I would like to write to QBS file to install a folder of files to a target directory recursively. That is the folder structure

.
├── A
│   ├── 1
│   │   └── A1.txt
│   └── A.txt
└── installer.qbs

And that is the qbs file:

import qbs
import qbs.Environment

Project {
    Product {
        Group {
            name: "all"
            files: "**"
            qbs.install: true
            qbs.installRoot: "/tmp/qbs"
        }
    }
}

However, if I run the qbs by `qbs install -v`. All the files will be copied in the same folder. The directory structure is broken.

$ qbs install -v

DEBUG: Copying file '/Users/benlau/src/github/junkcode/qt/qbs/A/1/A1.txt' into target directory '/tmp/qbs'.

DEBUG: Copying file '/Users/benlau/src/github/junkcode/qt/qbs/A/A.txt' into target directory '/tmp/qbs'.

$ ls /tmp/qbs

A.txt A1.txt

Any method to preserve the folder structure during installation?

Thx for any advise

The example source code

https://github.com/benlau/junkcode/tree/master/qt/qbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20171021/d2f6fc9b/attachment.html>


More information about the Qbs mailing list