-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
220 lines (206 loc) · 6.6 KB
/
CMakeLists.txt
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
cmake_minimum_required(VERSION 3.16)
project(bitmask VERSION 1.0 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(QT NAMES Qt5 Qt6 REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Qml Quick QuickControls2 Svg Widgets LinguistTools)
find_library(LIB_TO_INCLUDE goshim lib)
#qt_standard_project_setup()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
qt_add_executable(bitmask WIN32 MACOSX_BUNDLE
gui/handlers.cpp gui/handlers.h
gui/main.cpp
gui/qjsonmodel.cpp gui/qjsonmodel.h
lib/libgoshim.h
)
qt_add_qml_module(bitmask
URI bitmask
VERSION ${PROJECT_VERSION}
QML_FILES
gui/main.qml
gui/themes/themes.js
gui/themes/theme-riseup.js
gui/themes/Riseup.qml
gui/themes/theme-calyx.js
gui/themes/Calyx.qml
gui/themes/ThemeObject.qml
gui/components/MainView.qml
gui/components/ThemedPage.qml
gui/components/Splash.qml
gui/components/FadeBehavior.qml
gui/components/Home.qml
gui/components/Header.qml
gui/components/Footer.qml
gui/components/About.qml
gui/components/MaterialRadioButton.qml
gui/components/MaterialRadioIndicator.qml
gui/components/WrappedRadioButton.qml
gui/components/MaterialCheckBox.qml
gui/components/StatusBox.qml
gui/components/Systray.qml
gui/components/Help.qml
gui/components/Locations.qml
gui/components/SignalIcon.qml
gui/components/Preferences.qml
gui/components/BoldLabel.qml
gui/components/LightLabel.qml
gui/components/VPNButtonBase.qml
gui/components/VPNMouseArea.qml
gui/components/VerticalSpacer.qml
gui/components/Icon.qml
gui/components/MaterialButton.qml
gui/components/VPNState.qml
gui/components/InitErrors.qml
gui/components/ErrorBox.qml
gui/components/MotdBox.qml
gui/components/NavigationDrawer.qml
RESOURCES
gui/qtquickcontrols2.conf
gui/resources/icon-noshield.svg
gui/resources/location.svg
gui/resources/settings.svg
gui/resources/power.svg
gui/resources/language.svg
gui/resources/lightning.svg
gui/resources/close.svg
gui/resources/donate.svg
gui/resources/tools.svg
gui/resources/help.svg
gui/resources/about.svg
gui/resources/bridge.svg
gui/resources/gear-fill.svg
gui/resources/reception-0.svg
gui/resources/reception-2.svg
gui/resources/reception-4.svg
gui/resources/[email protected]
gui/resources/[email protected]
gui/resources/arrow-left.svg
gui/resources/globe.svg
gui/resources/spy.gif
gui/resources/quit.svg
gui/resources/alert.svg
gui/resources/angle-right.svg
gui/resources/snowflake.svg
gui/resources/ravens.svg
gui/resources/ravens.gif
gui/resources/riseup-icon.svg
gui/resources/calyx/calyx-shield-green.png
gui/resources/calyx/calyx-hand.png
gui/resources/calyx/calyx-red-shield.png
gui/resources/calyx/calyx-yellow-shield.png
gui/resources/fonts/Poppins-Regular.ttf
gui/resources/fonts/Poppins-Bold.ttf
gui/resources/fonts/Montserrat-SemiBold.ttf
gui/resources/fonts/Roboto-Regular.ttf
gui/resources/fonts/Roboto-Bold.ttf
gui/assets/icon/png/black/vpn_off.png
gui/assets/icon/png/black/vpn_on.png
gui/assets/icon/png/black/vpn_wait_0.png
gui/assets/icon/png/black/vpn_wait_1.png
gui/assets/icon/png/black/vpn_wait_2.png
gui/assets/icon/png/black/vpn_wait_3.png
gui/assets/icon/png/white/vpn_off.png
gui/assets/icon/png/white/vpn_on.png
gui/assets/icon/png/white/vpn_wait_0.png
gui/assets/icon/png/white/vpn_wait_1.png
gui/assets/icon/png/white/vpn_wait_2.png
gui/assets/icon/png/white/vpn_wait_3.png
gui/assets/img/bird.jpg
gui/providers/providers.json
NO_RESOURCE_TARGET_PATH
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/release
)
set_source_files_properties("gui/providers/providers.json"
PROPERTIES QT_RESOURCE_ALIAS "providers.json"
)
set_source_files_properties("gui/resources/fonts/Montserrat-SemiBold.ttf"
PROPERTIES QT_RESOURCE_ALIAS "monserrat-bold.ttf"
)
set_source_files_properties("gui/resources/fonts/Poppins-Bold.ttf"
PROPERTIES QT_RESOURCE_ALIAS "poppins-bold.ttf"
)
set_source_files_properties("gui/resources/fonts/Poppins-Regular.ttf"
PROPERTIES QT_RESOURCE_ALIAS "poppins-regular.ttf"
)
set_source_files_properties("gui/resources/fonts/Roboto-Bold.ttf"
PROPERTIES QT_RESOURCE_ALIAS "roboto-bold.ttf"
)
set_source_files_properties("gui/resources/fonts/Roboto-Regular.ttf"
PROPERTIES QT_RESOURCE_ALIAS "roboto.ttf"
)
# Avoid collision between executable name and QML module directory (QTBUG-98568).
if(NOT WIN32 AND NOT APPLE)
set_property(TARGET bitmask PROPERTY OUTPUT_NAME bitmask_app)
endif()
target_compile_definitions(bitmask PRIVATE
QT_DEPRECATED_WARNINGS
)
target_link_libraries(bitmask PRIVATE
# Remove: L../../lib
Qt::Core
Qt::Gui
Qt::Qml
Qt::Quick
Qt::QuickControls2
Qt::Svg
Qt::Widgets
${LIB_TO_INCLUDE}
pthread
)
# Resources:
set_source_files_properties("providers/riseup/assets/icon.svg"
PROPERTIES QT_RESOURCE_ALIAS "icon.svg"
)
set(vendor_resource_files
"providers/riseup/assets/icon.svg"
)
qt_add_resources(bitmask "vendor"
PREFIX
"/vendor/"
BASE
"providers/riseup"
FILES
${vendor_resource_files}
)
qt_add_translations(bitmask TS_FILES
gui/i18n/base.ts
gui/i18n/main_de.ts
gui/i18n/main_el.ts
gui/i18n/main_es_ES.ts
gui/i18n/main_es-rAR.ts
gui/i18n/main_es.ts
gui/i18n/main_et.ts
gui/i18n/main_fa_IR.ts
gui/i18n/main_fi.ts
gui/i18n/main_fr.ts
gui/i18n/main_hu.ts
gui/i18n/main_it.ts
gui/i18n/main_lt.ts
gui/i18n/main_nl.ts
gui/i18n/main_pl.ts
gui/i18n/main_pt-rBR.ts
gui/i18n/main_ru.ts
gui/i18n/main_th.ts
gui/i18n/main_tr.ts
gui/i18n/main_ug.ts
gui/i18n/main_zh-rTW.ts
gui/i18n/main_zh.ts
)
if(MACOS)
target_link_libraries(bitmask PRIVATE
"-framework CoreFoundation"
"-framework Security"
)
endif()
install(TARGETS bitmask
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
qt_generate_deploy_qml_app_script(
TARGET bitmask
FILENAME_VARIABLE deploy_script
NO_UNSUPPORTED_PLATFORM_ERROR
DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM
MACOS_BUNDLE_POST_BUILD
)
install(SCRIPT ${deploy_script})