aboutsummaryrefslogtreecommitdiff
path: root/smolbote.qbs
blob: 0637da3f71fd9596d596e1b6faf5663dfa406262 (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
import qbs
import "tools/qbs/GitRepo.js" as GitRepo

Project {
    id: project
    minimumQbsVersion: "1.8.0"

    property bool gitVersion: true

    // The following define makes your compiler emit warnings if you use any
    // feature of Qt which as been marked as deprecated (the exact warnings
    // depend on your compiler).
    property bool deprecatedWarnings: true

    // The code also fails to compile if you use APIs deprecated before Qt 5.9.
    property string deprecatedBefore: "0x050900"

    references: [
        "src/lib/bookmarks/bookmarks.qbs",
        "src/lib/navigation/navigation.qbs"
    ]

    CppApplication {
        id: poi
        name: "poi"
        property stringList defines: []

        Depends {
            name: "Qt"
            versionAtLeast: "5.9.0"
            submodules: ["core", "widgets", "webengine", "webenginewidgets"]
        }

        Depends {
            name: "navigation"
        }
        Depends {
            name: "bookmarks"
        }

        Probe {
            id: git
            property string version: ""
            property string describe: ""
            configure: {
                if(project.gitVersion) {
                    var meta = GitRepo.read(project.sourceDirectory);
                    version = meta.version;
                    describe = meta.describe;
                    found = true;
                }
            }
        }

        // enable clazy if using clang
        Properties {
            condition: cpp.compilerName.contains("clang")
            cpp.cxxFlags: ["-Xclang", "-load", "-Xclang", "ClangLazy.so", "-Xclang", "-add-plugin", "-Xclang", "clang-lazy"]
        }
        // global includes
        cpp.includePaths: ['src', 'src/3rd-party', 'src/lib']
        // global defines
        cpp.defines: {
            if(project.deprecatedWarnings)
                defines.push("QT_DEPRECATED_WARNINGS", "QT_DISABLE_DEPRECATED_BEFORE="+project.deprecatedBefore);
            return defines;
        }

        Group {
            name: "main"
            files: [
                "src/browser.cpp",
                "src/browser.h",
                "src/interfaces.h",
                "src/main.cpp",
                "src/settings.cpp",
                "src/settings.h",
                "src/singleapplication.cpp",
                "src/singleapplication.h",
            ]
            cpp.defines: {
                if(project.deprecatedWarnings)
                    defines.push("QT_DEPRECATED_WARNINGS", "QT_DISABLE_DEPRECATED_BEFORE="+project.deprecatedBefore);
                if(git.found)
                    defines.push('GIT_VERSION="'+git.version+'"', 'GIT_DESCRIBE="'+git.describe+'"');
                return defines;
            }
        }

        Group {
            name: "Main Window"
            files: [
                "src/mainwindow.cpp",
                "src/mainwindow.h",
                "src/mainwindow.ui",
                "src/forms/aboutdialog.cpp",
                "src/forms/aboutdialog.h",
                "src/forms/aboutdialog.ui",
                "src/webengine/webview.cpp",
                "src/webengine/webview.h",
                "src/widgets/dockingwidget.cpp",
                "src/widgets/dockingwidget.h",
                "src/widgets/loadingbar.cpp",
                "src/widgets/loadingbar.h",
                "src/widgets/mainwindowmenubar.cpp",
                "src/widgets/mainwindowmenubar.h",
                "src/widgets/webviewtabbar.cpp",
                "src/widgets/webviewtabbar.h",
            ]
        }

        Group {
            name: "downloads"
            files: [
                "src/forms/downloadsform.ui",
                "src/forms/downloadswidget.cpp",
                "src/forms/downloadswidget.h",
                "src/widgets/downloaditemform.ui",
                "src/widgets/downloaditemwidget.cpp",
                "src/widgets/downloaditemwidget.h",
            ]
        }

        Group {
            name: "Request Filter"
            files: [
                "src/filter/blockermanager.cpp",
                "src/filter/blockermanager.h",
                "src/filter/filter.cpp",
                "src/filter/filter.h",
                "src/filter/filtercollection.cpp",
                "src/filter/filtercollection.h",
                "src/filter/filtertree.cpp",
                "src/filter/filtertree.h",
                "src/filter/regexp.cpp",
                "src/filter/regexp.h",
                "src/filter/subscriptiondialog.ui",
                "src/filter/subscriptionform.ui",
                "src/webengine/urlinterceptor.cpp",
                "src/webengine/urlinterceptor.h",
            ]
            cpp.defines: {
                if(project.deprecatedWarnings)
                    defines.push("QT_DEPRECATED_WARNINGS", "QT_DISABLE_DEPRECATED_BEFORE="+project.deprecatedBefore);
                defines.push("DEBUG_VERBOSE")
                return defines;
            }
        }

        Group {
            name: "Profile"
            files: [
                "src/forms/cookiesform.cpp",
                "src/forms/cookiesform.h",
                "src/forms/cookiesform.ui",
                "src/forms/profilesdialog.cpp",
                "src/forms/profilesdialog.h",
                "src/forms/profilesdialog.ui",
                "src/forms/profileview.cpp",
                "src/forms/profileview.h",
                "src/forms/profileview.ui",
                "src/webengine/webengineprofile.cpp",
                "src/webengine/webengineprofile.h",
            ]
        }

        files: [
            "data/resources.qrc",
        ]

        Group {
            name: "Executable"
            fileTagsFilter: product.type
            qbs.install: true
            qbs.installDir: "bin"
        }

        Group {
            name: "Configuration"
            files: [
                "data/poi.toml",
            ]
            qbs.install: true
            qbs.installDir: "share/smolbote"
        }
    } // CppApplication poi

    SubProject {
        filePath: "src/plugins/plugins.qbs"
    }
}