qtcreator.qbs 2.84 KB
Newer Older
1
import qbs 1.0
Joerg Bornemann's avatar
Joerg Bornemann committed
2 3

Project {
4
    name: "Qt Creator"
5
    minimumQbsVersion: "1.4"
6
    property bool withAutotests: qbs.buildVariant === "debug"
Eike Ziller's avatar
Eike Ziller committed
7
    property string ide_version_major: '3'
Eike Ziller's avatar
Eike Ziller committed
8
    property string ide_version_minor: '5'
9
    property string ide_version_release: '82'
Joerg Bornemann's avatar
Joerg Bornemann committed
10
    property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release
Eike Ziller's avatar
Eike Ziller committed
11
    property string ide_compat_version_major: '3'
Eike Ziller's avatar
Eike Ziller committed
12
    property string ide_compat_version_minor: '5'
13
    property string ide_compat_version_release: '82'
Eike Ziller's avatar
Eike Ziller committed
14
    property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release
15
    property path ide_source_tree: path
Joerg Bornemann's avatar
Joerg Bornemann committed
16 17
    property string ide_app_path: qbs.targetOS.contains("osx") ? "" : "bin"
    property string ide_app_target: qbs.targetOS.contains("osx") ? "Qt Creator" : "qtcreator"
18 19 20
    property pathList additionalPlugins: []
    property pathList additionalLibs: []
    property pathList additionalTools: []
21
    property pathList additionalAutotests: []
22
    property string sharedSourcesDir: path + "/src/shared"
23
    property string libDirName: "lib"
24
    property string ide_library_path: {
Joerg Bornemann's avatar
Joerg Bornemann committed
25
        if (qbs.targetOS.contains("osx"))
Eike Ziller's avatar
Eike Ziller committed
26
            return ide_app_target + ".app/Contents/Frameworks"
Joerg Bornemann's avatar
Joerg Bornemann committed
27
        else if (qbs.targetOS.contains("windows"))
28 29
            return ide_app_path
        else
30
            return libDirName + "/qtcreator"
31 32
    }
    property string ide_plugin_path: {
Joerg Bornemann's avatar
Joerg Bornemann committed
33
        if (qbs.targetOS.contains("osx"))
Eike Ziller's avatar
Eike Ziller committed
34
            return ide_app_target + ".app/Contents/PlugIns"
Joerg Bornemann's avatar
Joerg Bornemann committed
35
        else if (qbs.targetOS.contains("windows"))
36
            return libDirName + "/qtcreator/plugins"
37 38 39
        else
            return ide_library_path + "/plugins"
    }
Joerg Bornemann's avatar
Joerg Bornemann committed
40
    property string ide_data_path: qbs.targetOS.contains("osx")
Joerg Bornemann's avatar
Joerg Bornemann committed
41 42
            ? ide_app_target + ".app/Contents/Resources"
            : "share/qtcreator"
Joerg Bornemann's avatar
Joerg Bornemann committed
43
    property string ide_libexec_path: qbs.targetOS.contains("osx")
44 45 46
            ? ide_data_path : qbs.targetOS.contains("windows")
            ? ide_app_path
            : "libexec/qtcreator"
Joerg Bornemann's avatar
Joerg Bornemann committed
47
    property string ide_doc_path: qbs.targetOS.contains("osx")
Joerg Bornemann's avatar
Joerg Bornemann committed
48 49
            ? ide_data_path + "/doc"
            : "share/doc/qtcreator"
Joerg Bornemann's avatar
Joerg Bornemann committed
50
    property string ide_bin_path: qbs.targetOS.contains("osx")
Joerg Bornemann's avatar
Joerg Bornemann committed
51 52
            ? ide_app_target + ".app/Contents/MacOS"
            : ide_app_path
53
    property bool testsEnabled: qbs.getEnv("TEST") || qbs.buildVariant === "debug"
54 55
    property stringList generalDefines: [
        "QT_CREATOR",
56
        'IDE_LIBRARY_BASENAME="' + libDirName + '"',
57 58 59
        "QT_NO_CAST_TO_ASCII",
        "QT_NO_CAST_FROM_ASCII"
    ].concat(testsEnabled ? ["WITH_TESTS"] : [])
60
    qbsSearchPaths: "qbs"
Joerg Bornemann's avatar
Joerg Bornemann committed
61 62

    references: [
63
        "src/src.qbs",
Joerg Bornemann's avatar
Joerg Bornemann committed
64
        "share/share.qbs",
65
        "share/qtcreator/translations/translations.qbs",
66
        "tests/tests.qbs"
Joerg Bornemann's avatar
Joerg Bornemann committed
67
    ]
68 69

    AutotestRunner {}
Joerg Bornemann's avatar
Joerg Bornemann committed
70
}