qtcreator.qbs 1.91 KB
Newer Older
1
import qbs 1.0
2
import qbs.Environment
3
import qbs.FileInfo
Joerg Bornemann's avatar
Joerg Bornemann committed
4 5

Project {
6
    name: "Qt Creator"
7
    minimumQbsVersion: "1.5.0"
8
    property bool withAutotests: qbs.buildVariant === "debug"
9
    property string licenseType: "opensource"
10
    property path ide_source_tree: path
11 12 13
    property pathList additionalPlugins: []
    property pathList additionalLibs: []
    property pathList additionalTools: []
14
    property pathList additionalAutotests: []
15
    property string sharedSourcesDir: path + "/src/shared"
16
    qbsSearchPaths: "qbs"
Joerg Bornemann's avatar
Joerg Bornemann committed
17 18

    references: [
19
        "doc/doc.qbs",
20
        "src/src.qbs",
Joerg Bornemann's avatar
Joerg Bornemann committed
21
        "share/share.qbs",
22
        "share/qtcreator/translations/translations.qbs",
23
        "tests/tests.qbs"
Joerg Bornemann's avatar
Joerg Bornemann committed
24
    ]
25

26 27
    AutotestRunner {
        Depends { name: "Qt.core" }
28
        Depends { name: "qtc" }
29 30 31 32 33 34 35 36 37 38 39 40 41
        environment: {
            var env = base;
            if (!qbs.hostOS.contains("windows") || !qbs.targetOS.contains("windows"))
                return env;
            var path = "";
            for (var i = 0; i < env.length; ++i) {
                if (env[i].startsWith("PATH=")) {
                    path = env[i].substring(5);
                    break;
                }
            }
            var fullQtcInstallDir
                    = FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix, qbs.InstallDir);
42 43 44 45
            var fullLibInstallDir = FileInfo.joinPaths(fullQtcInstallDir,
                    product.moduleProperty("ide", "ide_library_path"));
            var fullPluginInstallDir = FileInfo.joinPaths(fullQtcInstallDir,
                    product.moduleProperty("qtc", "ide_plugin_path"));
46 47 48 49 50 51 52 53 54 55
            path = Qt.core.binPath + ";" + fullLibInstallDir + ";" + fullPluginInstallDir
                    + ";" + path;
            var arrayElem = "PATH=" + path;
            if (i < env.length)
                env[i] = arrayElem;
            else
                env.push(arrayElem);
            return env;
        }
    }
Joerg Bornemann's avatar
Joerg Bornemann committed
56
}