qtcreator.qbs 2.21 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 28 29 30 31 32 33 34 35 36 37
    Product {
        name: "qbs_imports_modules"
        Depends { name: "qtc" }
        Group {
            prefix: "qbs/"
            files: ["**/*"]
            qbs.install: qtc.make_dev_package
            qbs.installDir: qtc.ide_qbs_resources_path
            qbs.installSourceBase: "qbs"
        }
    }

38 39
    AutotestRunner {
        Depends { name: "Qt.core" }
40
        Depends { name: "qtc" }
41 42 43 44 45 46 47 48 49 50 51 52 53
        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);
54 55 56 57
            var fullLibInstallDir = FileInfo.joinPaths(fullQtcInstallDir,
                    product.moduleProperty("ide", "ide_library_path"));
            var fullPluginInstallDir = FileInfo.joinPaths(fullQtcInstallDir,
                    product.moduleProperty("qtc", "ide_plugin_path"));
58 59 60 61 62 63 64 65 66 67
            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
68
}