aboutsummaryrefslogtreecommitdiffstats
path: root/tutorial/chapter-9/qbs/modules/mybuildconfig/mybuildconfig.qbs
blob: 7aed8f7ebd42f7f613ef6acbba35f6a78de9360c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import qbs.FileInfo

//! [0]
// qbs/modules/mybuildconfig/mybuildconfig.qbs
Module {
    Depends { name: "cpp" }

    property string productVersion: "1.0.0"
    // ...
    //! [0]
    property string appInstallDir: "bin"
    property string libDirName: "lib"
    property string libInstallDir: qbs.targetOS.contains("windows") ? "bin" : libDirName
    property bool staticBuild: false
    property bool installStaticLib: true
    property bool enableRPath: true

    property stringList libRPaths: {
        if (enableRPath && cpp.rpathOrigin && product.installDir) {
            return [
                FileInfo.joinPaths(
                    cpp.rpathOrigin,
                    FileInfo.relativePath(
                        FileInfo.joinPaths('/', product.installDir),
                        FileInfo.joinPaths('/', libDirName)))
            ];
        }
        return [];
    }
}