forked from vedderb/vesc_tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vesc_tool.pro
260 lines (217 loc) · 6.02 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
#-------------------------------------------------
#
# Project created by QtCreator 2016-08-12T21:55:19
#
#-------------------------------------------------
# Version
VT_VERSION = 3.00
VT_INTRO_VERSION = 1
VT_IS_TEST_VERSION = 0
VT_ANDROID_VERSION_ARMV7 = 95
VT_ANDROID_VERSION_ARM64 = 96
VT_ANDROID_VERSION_X86 = 97
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
DEFINES += VT_VERSION=$$VT_VERSION
DEFINES += VT_INTRO_VERSION=$$VT_INTRO_VERSION
!vt_test_version: {
DEFINES += VT_IS_TEST_VERSION=$$VT_IS_TEST_VERSION
}
vt_test_version: {
DEFINES += VT_IS_TEST_VERSION=1
}
CONFIG += c++11
QMAKE_CXXFLAGS += -Wno-deprecated-copy
# Build mobile GUI
#CONFIG += build_mobile
# 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
!android: {
# Serial port available
DEFINES += HAS_SERIALPORT
DEFINES += HAS_GAMEPAD
}
win32: {
DEFINES += _USE_MATH_DEFINES
}
# 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 += printsupport
QT += network
QT += quick
QT += quickcontrols2
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
android: TARGET = vesc_tool
!android: 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\
mainwindow.cpp \
packet.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
HEADERS += mainwindow.h \
packet.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
FORMS += mainwindow.ui \
parametereditor.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)
RESOURCES += res.qrc \
res_fw_bms.qrc \
res_qml.qrc
RESOURCES += res_config.qrc
build_original {
RESOURCES += res_original.qrc \
res_fw_original.qrc
DEFINES += VER_ORIGINAL
} else:build_platinum {
RESOURCES += res_platinum.qrc \
res_fw.qrc
DEFINES += VER_PLATINUM
} else:build_gold {
RESOURCES += res_gold.qrc \
res_fw.qrc
DEFINES += VER_GOLD
} else:build_silver {
RESOURCES += res_silver.qrc \
res_fw.qrc
DEFINES += VER_SILVER
} else:build_bronze {
RESOURCES += res_bronze.qrc \
res_fw.qrc
DEFINES += VER_BRONZE
} else:build_free {
RESOURCES += res_free.qrc \
res_fw.qrc
DEFINES += VER_FREE
} else {
RESOURCES += res_neutral.qrc \
res_fw.qrc
DEFINES += VER_NEUTRAL
}
DISTFILES += \
android/AndroidManifest.xml \
android/gradle/wrapper/gradle-wrapper.jar \
android/gradlew \
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