aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/app.qbs
blob: 5c293781c29b92859c0fc863f33422eda5fdc314 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import qbs

QtcProduct {
    Depends { name: "bundle" }
    Depends { name: "ib"; condition: qbs.targetOS.contains("macos") }

    Properties {
        condition: qbs.targetOS.contains("macos")
        ib.appIconName: "qtcreator"
    }

    Properties {
        condition: qbs.targetOS.contains("windows")
        consoleApplication: qbs.debugInformation
    }
    consoleApplication: false

    type: ["application"]
    name: "qtcreator"
    targetName: qtc.ide_app_target
    version: qtc.qtcreator_version

    property bool isBundle: qbs.targetOS.contains("darwin") && bundle.isBundle
    installDir: isBundle ? qtc.ide_app_path : qtc.ide_bin_path
    installTags: (isBundle ? ["bundle.content"] : base).concat(["debuginfo_app"])
    property bool qtcRunnable: true

    bundle.identifier: qtc.ide_bundle_identifier

    // Some of these are in here only to override the entries added to app-Info.plist with other
    // build systems in mind.
    bundle.infoPlist: ({
        "NSHumanReadableCopyright": qtc.qtcreator_copyright_string,
        "CFBundleExecutable": qtc.ide_app_target,
        "CFBundleIdentifier": qtc.ide_bundle_identifier,
        "CFBundleVersion": version
    })

    cpp.rpaths: qbs.targetOS.contains("macos") ? ["@executable_path/../Frameworks"]
                                             : ["$ORIGIN/../" + qtc.libDirName + "/qtcreator"]
    cpp.includePaths: [
        project.sharedSourcesDir + "/qtsingleapplication",
    ]

    cpp.frameworks: base.concat(qbs.targetOS.contains("macos") ? ["Foundation"] : [])

    Depends { name: "app_version_header" }
    Depends { name: "Qt"; submodules: ["widgets", "network"] }
    Depends { name: "Utils" }
    Depends { name: "ExtensionSystem" }

    files: [
        "app-Info.plist",
        "app_logo.qrc",
        "main.cpp",
        "qtcreator.xcassets",
        "../shared/qtsingleapplication/qtsingleapplication.h",
        "../shared/qtsingleapplication/qtsingleapplication.cpp",
        "../shared/qtsingleapplication/qtlocalpeer.h",
        "../shared/qtsingleapplication/qtlocalpeer.cpp",
        "../tools/qtcreatorcrashhandler/crashhandlersetup.cpp",
        "../tools/qtcreatorcrashhandler/crashhandlersetup.h"
    ]

    Group {
        // We need the version in two separate formats for the .rc file
        //  RC_VERSION=4,3,82,0 (quadruple)
        //  RC_VERSION_STRING="4.4.0-beta1" (free text)
        // Also, we need to replace space with \x20 to be able to work with both rc and windres
        cpp.defines: outer.concat(["RC_VERSION=" + qtc.qtcreator_version.replace(/\./g, ",") + ",0",
                                   "RC_VERSION_STRING=" + qtc.qtcreator_display_version,
                                   "RC_COPYRIGHT=2008-" + qtc.qtcreator_copyright_year
                                   + " The Qt Company Ltd".replace(/ /g, "\\x20"),
                                   "RC_ICON_PATH=."])
        files: "qtcreator.rc"
    }

    Group {
        name: "qtcreator.sh"
        condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos")
        files: "../../bin/qtcreator.sh"
        qbs.install: true
        qbs.installDir: "bin"
    }

    Group {
        name: "main_macos"
        condition: qbs.targetOS.contains("macos")
        files: [
            "main_mac.mm"
        ]
    }
}