-
Notifications
You must be signed in to change notification settings - Fork 524
/
vesc_tool.pro
378 lines (315 loc) · 8.99 KB
/
vesc_tool.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
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
#-------------------------------------------------
#
# Project created by QtCreator 2016-08-12T21:55:19
#
#-------------------------------------------------
# Version
VT_VERSION = 6.06
VT_INTRO_VERSION = 1
VT_CONFIG_VERSION = 4
# Set to 0 for stable versions and to test version number for development versions.
VT_IS_TEST_VERSION = 2
# GIT commit
VT_GIT_COMMIT = $$system(git rev-parse --short=8 HEAD)
VT_ANDROID_VERSION_ARMV7 = 162
VT_ANDROID_VERSION_ARM64 = 163
VT_ANDROID_VERSION_X86 = 164
VT_ANDROID_VERSION = $$VT_ANDROID_VERSION_X86
# Ubuntu 18.04 (should work on raspbian buster too)
# sudo apt install qml-module-qt-labs-folderlistmodel qml-module-qtquick-extras qml-module-qtquick-controls2 qt5-default libqt5quickcontrols2-5 qtquickcontrols2-5-dev qtcreator qtcreator-doc libqt5serialport5-dev build-essential qml-module-qt3d qt3d5-dev qtdeclarative5-dev qtconnectivity5-dev qtmultimedia5-dev qtpositioning5-dev qtpositioning5-dev libqt5gamepad5-dev qml-module-qt-labs-settings qml-module-qt-labs-platform libqt5svg5-dev
DEFINES += VT_VERSION=$$VT_VERSION
DEFINES += VT_INTRO_VERSION=$$VT_INTRO_VERSION
DEFINES += VT_CONFIG_VERSION=$$VT_CONFIG_VERSION
DEFINES += VT_IS_TEST_VERSION=$$VT_IS_TEST_VERSION
DEFINES += VT_GIT_COMMIT=$$VT_GIT_COMMIT
QT_LOGGING_RULES="qt.qml.connections=false"
#CONFIG += qtquickcompiler
CONFIG += c++11
CONFIG += resources_big
ios: {
QMAKE_CXXFLAGS_DEBUG += -Wall
}
!win32-msvc*: { !android: {
QMAKE_CXXFLAGS += -Wno-deprecated-copy
}}
# Build mobile GUI
#CONFIG += build_mobile
# Exclude built-in firmwares
#CONFIG += exclude_fw
ios: {
CONFIG += build_mobile
DEFINES += QT_NO_PRINTER
}
# Debug build (e.g. F5 to reload QML files)
#DEFINES += DEBUG_BUILD
# If BLE disconnects on ubuntu after about 90 seconds the reason is most likely that the connection interval is incompatible. This can be fixed with:
# sudo bash -c 'echo 6 > /sys/kernel/debug/bluetooth/hci0/conn_min_interval'
# Clear old bluetooth devices
# sudo rm -rf /var/lib/bluetooth/*
# sudo service bluetooth restart
# Bluetooth available
DEFINES += HAS_BLUETOOTH
# CAN bus available
# Adding serialbus to Qt seems to break the serial port on static builds. TODO: Figure out why.
#DEFINES += HAS_CANBUS
# Positioning
DEFINES += HAS_POS
!ios: {
QT += printsupport
!android: {
# Serial port available
DEFINES += HAS_SERIALPORT
DEFINES += HAS_GAMEPAD
}
}
win32: {
DEFINES += _USE_MATH_DEFINES
}
# https://stackoverflow.com/questions/61444320/what-are-the-configure-options-for-qt-that-enable-dead-keys-usage
unix: {
!ios: {
QTPLUGIN += composeplatforminputcontextplugin
}
}
# Options
#CONFIG += build_original
#CONFIG += build_platinum
#CONFIG += build_gold
#CONFIG += build_silver
#CONFIG += build_bronze
#CONFIG += build_free
QT += core gui
QT += widgets
QT += network
QT += quick
QT += quickcontrols2
QT += quickwidgets
QT += svg
QT += gui-private
contains(DEFINES, HAS_SERIALPORT) {
QT += serialport
}
contains(DEFINES, HAS_CANBUS) {
QT += serialbus
}
contains(DEFINES, HAS_BLUETOOTH) {
QT += bluetooth
}
contains(DEFINES, HAS_POS) {
QT += positioning
}
contains(DEFINES, HAS_GAMEPAD) {
QT += gamepad
}
android: QT += androidextras
ios | macx: {
TARGET = "VESC Tool"
}else: {
android:{
TARGET = "vesc_tool"
}else:{
TARGET = vesc_tool_$$VT_VERSION
}
}
ANDROID_VERSION = 1
android:contains(QT_ARCH, i386) {
VT_ANDROID_VERSION = $$VT_ANDROID_VERSION_X86
}
contains(ANDROID_TARGET_ARCH, arm64-v8a) {
VT_ANDROID_VERSION = $$VT_ANDROID_VERSION_ARM64
}
contains(ANDROID_TARGET_ARCH, armeabi-v7a) {
VT_ANDROID_VERSION = $$VT_ANDROID_VERSION_ARMV7
}
android: {
manifest.input = $$PWD/android/AndroidManifest.xml.in
manifest.output = $$PWD/android/AndroidManifest.xml
QMAKE_SUBSTITUTES += manifest
}
TEMPLATE = app
release_win {
DESTDIR = build/win
OBJECTS_DIR = build/win/obj
MOC_DIR = build/win/obj
RCC_DIR = build/win/obj
UI_DIR = build/win/obj
}
release_lin {
# http://micro.nicholaswilson.me.uk/post/31855915892/rules-of-static-linking-libstdc-libc-libgcc
# http://insanecoding.blogspot.se/2012/07/creating-portable-linux-binaries.html
QMAKE_LFLAGS += -static-libstdc++ -static-libgcc
DESTDIR = build/lin
OBJECTS_DIR = build/lin/obj
MOC_DIR = build/lin/obj
RCC_DIR = build/lin/obj
UI_DIR = build/lin/obj
}
release_macos {
# brew install qt
DESTDIR = build/macos
OBJECTS_DIR = build/macos/obj
MOC_DIR = build/macos/obj
RCC_DIR = build/macos/obj
UI_DIR = build/macos/obj
}
release_android {
DESTDIR = build/android
OBJECTS_DIR = build/android/obj
MOC_DIR = build/android/obj
RCC_DIR = build/android/obj
UI_DIR = build/android/obj
}
build_mobile {
DEFINES += USE_MOBILE
}
SOURCES += main.cpp\
bleuartdummy.cpp \
codeloader.cpp \
mainwindow.cpp \
boardsetupwindow.cpp \
packet.cpp \
preferences.cpp \
tcphub.cpp \
udpserversimple.cpp \
vbytearray.cpp \
commands.cpp \
configparams.cpp \
configparam.cpp \
vescinterface.cpp \
parametereditor.cpp \
digitalfiltering.cpp \
setupwizardapp.cpp \
setupwizardmotor.cpp \
startupwizard.cpp \
utility.cpp \
tcpserversimple.cpp \
hexfile.cpp
HEADERS += mainwindow.h \
bleuartdummy.h \
codeloader.h \
boardsetupwindow.h \
packet.h \
preferences.h \
tcphub.h \
udpserversimple.h \
vbytearray.h \
commands.h \
datatypes.h \
configparams.h \
configparam.h \
vescinterface.h \
parametereditor.h \
digitalfiltering.h \
setupwizardapp.h \
setupwizardmotor.h \
startupwizard.h \
utility.h \
tcpserversimple.h \
hexfile.h
unix: {
!ios: {
HEADERS += systemcommandexecutor.h
}
}
FORMS += mainwindow.ui \
boardsetupwindow.ui \
parametereditor.ui \
preferences.ui
contains(DEFINES, HAS_BLUETOOTH) {
SOURCES += bleuart.cpp
HEADERS += bleuart.h
}
include(pages/pages.pri)
include(widgets/widgets.pri)
include(mobile/mobile.pri)
include(map/map.pri)
include(lzokay/lzokay.pri)
include(heatshrink/heatshrink.pri)
include(QCodeEditor/qcodeeditor.pri)
include(esp32/esp32.pri)
include(display_tool/display_tool.pri)
include(qmarkdowntextedit/qmarkdowntextedit.pri)
include(maddy/maddy.pri)
include(minimp3/minimp3.pri)
RESOURCES += res.qrc \
res_custom_module.qrc \
res_lisp.qrc \
res_qml.qrc
RESOURCES += res_config.qrc
RESOURCES += res_fw_bms.qrc
RESOURCES += res/firmwares_esp/res_fw_esp.qrc
!exclude_fw {
RESOURCES += res/firmwares/res_fw.qrc
}
build_original {
RESOURCES += res_original.qrc
DEFINES += VER_ORIGINAL
} else:build_platinum {
RESOURCES += res_platinum.qrc
DEFINES += VER_PLATINUM
} else:build_gold {
RESOURCES += res_gold.qrc
DEFINES += VER_GOLD
} else:build_silver {
RESOURCES += res_silver.qrc
DEFINES += VER_SILVER
} else:build_bronze {
RESOURCES += res_bronze.qrc
DEFINES += VER_BRONZE
} else:build_free {
RESOURCES += res_free.qrc
DEFINES += VER_FREE
} else {
RESOURCES += res_neutral.qrc
DEFINES += VER_NEUTRAL
}
DISTFILES += \
android/AndroidManifest.xml \
android/gradle/wrapper/gradle-wrapper.jar \
android/gradlew \
android/gradlew.bat \
android/res/values/libs.xml \
android/build.gradle \
android/gradle/wrapper/gradle-wrapper.properties \
android/src/com/vedder/vesc/VForegroundService.java \
android/src/com/vedder/vesc/Utils.java
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
macx-clang:contains(QMAKE_HOST.arch, arm.*): {
QMAKE_APPLE_DEVICE_ARCHS=arm64
}
macx {
ICON = macos/appIcon.icns
QMAKE_INFO_PLIST = macos/Info.plist
DISTFILES += macos/Info.plist
QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_OBJECTIVE_CFLAGS_RELEASE = $$QMAKE_OBJECTIVE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
}
ios {
QMAKE_INFO_PLIST = ios/Info.plist
HEADERS += ios/src/setIosParameters.h
SOURCES += ios/src/setIosParameters.mm
DISTFILES += ios/Info.plist \
ios/*.storyboard
QMAKE_ASSET_CATALOGS = $$PWD/ios/Images.xcassets
QMAKE_ASSET_CATALOGS_APP_ICON = "AppIcon"
ios_artwork.files = $$files($$PWD/ios/iTunesArtwork*.png)
QMAKE_BUNDLE_DATA += ios_artwork
app_launch_images.files = $$files($$PWD/ios/LaunchImage*.png)
QMAKE_BUNDLE_DATA += app_launch_images
app_launch_screen.files = $$files($$PWD/ios/MyLaunchScreen.storyboard)
QMAKE_BUNDLE_DATA += app_launch_screen
#QMAKE_IOS_DEPLOYMENT_TARGET = 11.0
disable_warning.name = GCC_WARN_64_TO_32_BIT_CONVERSION
disable_warning.value = NO
QMAKE_MAC_XCODE_SETTINGS += disable_warning
# Note for devices: 1=iPhone, 2=iPad, 1,2=Universal.
CONFIG -= warn_on
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1,2
}
CONFIG -= warn_on
contains(ANDROID_TARGET_ARCH,) {
ANDROID_ABIS = \
armeabi-v7a
}