qtcreator.qbs 2.51 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.8.0"
8
    property string minimumMacosVersion: "10.8"
9
    property bool withAutotests: qbs.buildVariant === "debug"
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 40 41 42 43 44 45 46 47 48 49 50
    Product {
        name: "qmake project files"
        files: {
            var list = ["**/*.pr[io]"];
            var props = [additionalPlugins, additionalLibs, additionalTools, additionalAutotests];
            for (var i = 0; i < props.length; ++i) {
                for (var j = 0; j < props[i].length; ++j)
                    list.push(props[i][j] + "/**/*.pr[io]");
            }
            return list;
        }
    }

51 52
    AutotestRunner {
        Depends { name: "Qt.core" }
53
        Depends { name: "qtc" }
54 55 56 57 58 59 60 61 62 63 64
        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;
                }
            }
65
            var fullQtcInstallDir = FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix);
Tim Jenssen's avatar
Tim Jenssen committed
66 67
            var fullLibInstallDir = FileInfo.joinPaths(fullQtcInstallDir, qtc.ide_library_path);
            var fullPluginInstallDir = FileInfo.joinPaths(fullQtcInstallDir, qtc.ide_plugin_path);
68 69 70 71 72 73 74 75 76 77
            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
78
}