forked from Qv2ray/Qv2ray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Qv2ray.pro
168 lines (148 loc) · 6.83 KB
/
Qv2ray.pro
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
#-------------------------------------------------
#
# Project created by QtCreator 2019-03-28T08:45:32
#
#-------------------------------------------------
QT += core gui widgets network
TARGET = qv2ray
TEMPLATE = app
# Now read build number file.
QV2RAY_VERSION=$$cat($$PWD/makespec/VERSION)
QV2RAY_BUILD_VERSION=$$cat($$PWD/makespec/BUILDVERSION)
VERSION = $${QV2RAY_VERSION}.$${QV2RAY_BUILD_VERSION}
message(" ")
message("Qv2ray Version: $${VERSION}")
message("|-------------------------------------------------|")
message("| Qv2ray, A Cross Platform v2ray Qt GUI Client. |")
message("| Licenced under GPLv3 |")
message("| |")
message("| You may only use this program to the extent |")
message("| permitted by local law. |")
message("| |")
message("| See: https://www.gnu.org/licenses/gpl-3.0.html |")
message("|-------------------------------------------------|")
message("| Project Homepage: https://github.com/Qv2ray |")
message("| Welcome to contribute! |")
message("|-------------------------------------------------|")
message(" ")
# Distinguish debug and release builds.
CONFIG(release, debug|release) {
CONFIG+=Qv2ray_release no_increase_build_number
}
CONFIG(debug, debug|release) {
CONFIG+=Qv2ray_debug
}
# Qv2ray basic configuration
CONFIG += qt c++17 openssl-linked
include($$PWD/makespec/00-deps.pri)
# lrelease will not work when adding BEFORE 00-deps.pri
CONFIG += lrelease embed_translations
DEFINES += QT_DEPRECATED_WARNINGS QV2RAY_VERSION_STRING=\"\\\"v$${VERSION}\\\"\" QAPPLICATION_CLASS=QApplication
# Source file parser
include($$PWD/makespec/01-sourcesparser.pri)
# Main config
Qv2rayAddSource(base, _, GlobalInstances, hpp)
Qv2rayAddSource(base, _, JsonHelpers, hpp)
Qv2rayAddSource(base, _, Qv2rayBase, hpp)
Qv2rayAddSource(base, _, Qv2rayFeatures, hpp)
Qv2rayAddSource(base, _, Qv2rayLog, cpp, hpp)
Qv2rayAddSource(base, models, CoreObjectModels, hpp)
Qv2rayAddSource(base, models, QvConfigModel, hpp)
Qv2rayAddSource(base, models, QvConfigIdentifier, hpp)
Qv2rayAddSource(base, models, QvSafeType, hpp)
Qv2rayAddSource(base, models, QvRuntimeConfig, hpp)
Qv2rayAddSource(base, models, QvStartupConfig, hpp)
Qv2rayAddSource(common, _, CommandArgs, cpp, hpp)
Qv2rayAddSource(common, _, HTTPRequestHelper, cpp, hpp)
Qv2rayAddSource(common, _, LogHighlighter, cpp, hpp)
Qv2rayAddSource(common, _, QJsonModel, cpp, hpp)
Qv2rayAddSource(common, _, QvHelpers, cpp, hpp)
Qv2rayAddSource(common, _, QvTranslator, hpp)
Qv2rayAddSource(components, autolaunch, QvAutoLaunch, cpp, hpp)
Qv2rayAddSource(components, pac, QvGFWPACConverter, cpp)
Qv2rayAddSource(components, pac, QvPACHandler, cpp, hpp)
Qv2rayAddSource(components, plugins/toolbar, QvToolbar, cpp, hpp)
Qv2rayAddSource(components, plugins/toolbar, QvToolbar_linux, cpp)
Qv2rayAddSource(components, plugins/toolbar, QvToolbar_win, cpp)
Qv2rayAddSource(components, proxy, QvProxyConfigurator, cpp, hpp)
Qv2rayAddSource(components, tcping, QvTCPing, cpp, hpp)
Qv2rayAddSource(components, speedchart, speedwidget, cpp, hpp)
Qv2rayAddSource(components, speedchart, speedplotview, cpp, hpp)
Qv2rayAddSource(components, geosite, QvGeositeReader, cpp, hpp)
Qv2rayAddSource(core, config, ConfigBackend, cpp, hpp)
Qv2rayAddSource(core, config, ConfigUpgrade, cpp)
Qv2rayAddSource(core, connection, ConnectionIO, cpp, hpp)
Qv2rayAddSource(core, connection, Generation, cpp, hpp)
Qv2rayAddSource(core, connection, Serialization, cpp, hpp)
Qv2rayAddSource(core, _, CoreUtils, cpp, hpp)
Qv2rayAddSource(core, kernel, KernelInteractions, cpp, hpp)
Qv2rayAddSource(core, kernel, APIBackend, cpp, hpp)
Qv2rayAddSource(ui, editors, w_InboundEditor, cpp, hpp, ui)
Qv2rayAddSource(ui, editors, w_JsonEditor, cpp, hpp, ui)
Qv2rayAddSource(ui, editors, w_OutboundEditor, cpp, hpp, ui)
Qv2rayAddSource(ui, editors, w_RoutesEditor, cpp, hpp, ui)
Qv2rayAddSource(ui, editors, w_RoutesEditor_extra, cpp)
Qv2rayAddSource(ui, nodemodels, InboundNodeModel, cpp, hpp)
Qv2rayAddSource(ui, nodemodels, OutboundNodeModel, cpp, hpp)
Qv2rayAddSource(ui, nodemodels, RuleNodeModel, cpp, hpp)
Qv2rayAddSource(ui, nodemodels, NodeModelsBase, hpp)
Qv2rayAddSource(ui, messaging, QvMessageBus, cpp, hpp)
Qv2rayAddSource(ui, _, w_ExportConfig, cpp, hpp, ui)
Qv2rayAddSource(ui, _, w_ImportConfig, cpp, hpp, ui)
Qv2rayAddSource(ui, _, w_MainWindow, cpp, hpp, ui)
Qv2rayAddSource(ui, _, w_MainWindow_extra, cpp)
Qv2rayAddSource(ui, _, w_PreferencesWindow, cpp, hpp, ui)
Qv2rayAddSource(ui, _, w_ScreenShot_Core, cpp, hpp, ui)
Qv2rayAddSource(ui, _, w_SubscriptionManager, cpp, hpp, ui)
Qv2rayAddSource(ui, widgets, StreamSettingsWidget, cpp, hpp, ui)
SOURCES += $$PWD/src/main.cpp
HEADERS +=
FORMS +=
INCLUDEPATH += $$PWD/src
RESOURCES += $$PWD/resources.qrc
ICON = $$PWD/assets/icons/qv2ray.icns
RC_ICONS += $$PWD/assets/icons/qv2ray.ico
include($$PWD/makespec/02-translations.pri)
unix {
include($$PWD/makespec/03-unix.pri)
# Sub-process of Qv2ray per-OS build
!macx: include($$PWD/makespec/04-unix-linux.pri)
macx: include($$PWD/makespec/04-unix-macOS.pri)
} else {
include($$PWD/makespec/03-Windows.pri)
}
# ------------------------------------------ Begin checking protobuf domain list headers.
!exists($$PWD/libs/gen/v2ray_geosite.pb.cc) || !exists($$PWD/libs/gen/v2ray_geosite.pb.cc) {
Qv2rayQMakeError("Protobuf headers for v2ray geosite is missing.")
}
SOURCES += $$PWD/libs/gen/v2ray_geosite.pb.cc
HEADERS += $$PWD/libs/gen/v2ray_geosite.pb.h
# General header and source files for gRPC and libQvb
message(" ")
use_grpc {
DEFINES += WITH_LIB_GRPCPP
message("Qv2ray will use gRPC as API backend")
!exists($$PWD/libs/gen/v2ray_api.grpc.pb.h) || !exists($$PWD/libs/gen/v2ray_api.grpc.pb.cc) || !exists($$PWD/libs/gen/v2ray_api.pb.h) || !exists($$PWD/libs/gen/v2ray_api.pb.cc) {
Qv2rayQMakeError("gRPC and protobuf headers for v2ray API is missing.")
}
SOURCES += $$PWD/libs/gen/v2ray_api.pb.cc $$PWD/libs/gen/v2ray_api.grpc.pb.cc
HEADERS += $$PWD/libs/gen/v2ray_api.pb.h $$PWD/libs/gen/v2ray_api.grpc.pb.h
} else {
message("Qv2ray will use libqvb as API backend")
!exists($$PWD/libs/libqvb/build/libqvb.h) {
Qv2rayQMakeError("libs/libqvb/build/libqvb.h is missing.")
}
HEADERS += $$PWD/libs/libqvb/build/libqvb.h
}
# Misc steps to build Qv2ray.
include($$PWD/makespec/99-others.pri)
message(" ")
message("This Qv2ray build contains: ")
message(" --> $${size(SOURCES)} source files")
message(" --> $${size(HEADERS)} header files")
message(" --> $${size(FORMS)} ui files")
message(" --> $${size(TRANSLATIONS)} translation files")
message(" --> $${size(EXTRA_TRANSLATIONS)} extra translation files")
message(" ")
message("Finished configuring Qv2ray project. Build output will be at:" $$OUT_PWD)
message("Type 'make' or 'nmake' to start building Qv2ray")