forked from GPSBabel/gpsbabel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GPSBabel.pro
279 lines (248 loc) · 9.24 KB
/
GPSBabel.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
# Enforce minimum Qt version.
# versionAtLeast() was introduced in Qt 5.10, so we can't count on it being available.
MIN_QT_VERSION = 5.9 # major[.minor[.patch]]
MIN_QT_VERSION_COMPONENTS = $$split(MIN_QT_VERSION, .)
MIN_QT_VERSION_MAJOR = $$member(MIN_QT_VERSION_COMPONENTS, 0)
MIN_QT_VERSION_MINOR = $$member(MIN_QT_VERSION_COMPONENTS, 1)
MIN_QT_VERSION_PATCH = $$member(MIN_QT_VERSION_COMPONENTS, 2)
count(MIN_QT_VERSION_MINOR, 0): MIN_QT_VERSION_MINOR = 0
count(MIN_QT_VERSION_PATCH, 0): MIN_QT_VERSION_PATCH = 0
lessThan(QT_MAJOR_VERSION, $$MIN_QT_VERSION_MAJOR) | \
if(equals(QT_MAJOR_VERSION, $$MIN_QT_VERSION_MAJOR):lessThan(QT_MINOR_VERSION, $$MIN_QT_VERSION_MINOR)) | \
if(equals(QT_MAJOR_VERSION, $$MIN_QT_VERSION_MAJOR):equals(QT_MINOR_VERSION, $$MIN_QT_VERSION_MINOR):lessThan(QT_PATCH_VERSION, $$MIN_QT_VERSION_PATCH)) {
error("$$QMAKE_QMAKE uses Qt version $$QT_VERSION but version $${MIN_QT_VERSION_MAJOR}.$${MIN_QT_VERSION_MINOR}.$${MIN_QT_VERSION_PATCH} or newer is required.")
}
QT -= gui
linux: {
TARGET = gpsbabel
} else {
TARGET = GPSBabel
}
CONFIG += console
CONFIG -= app_bundle
CONFIG += c++14
TEMPLATE = app
MINIMAL_FMTS = magproto.cc explorist_ini.cc gpx.cc geo.cc mapsend.cc mapsource.cc garmin.cc \
garmin_device_xml.cc garmin_tables.cc internal_styles.cc nmea.cc \
kml.cc wbt-200.cc
ALL_FMTS=$$MINIMAL_FMTS gtm.cc gpsutil.cc pcx.cc \
skytraq.cc holux.cc tmpro.cc tpg.cc tpo.cc \
xcsv.cc tiger.cc easygps.cc \
saroute.cc navicache.cc psitrex.cc delgpl.cc \
ozi.cc text.cc html.cc netstumbler.cc \
igc.cc brauniger_iq.cc shape.cc hiketech.cc glogbook.cc \
vcf.cc lowranceusr.cc an1.cc tomtom.cc \
tef_xml.cc maggeo.cc vitosmt.cc gdb.cc bcr.cc \
ignrando.cc stmwpp.cc cst.cc nmn4.cc compegps.cc \
yahoo.cc unicsv.cc wfff_xml.cc garmin_txt.cc gpssim.cc \
stmsdf.cc gtrnctr.cc dmtlog.cc raymarine.cc alan.cc vitovtt.cc \
ggv_log.cc g7towin.cc garmin_gpi.cc lmx.cc random.cc xol.cc dg-100.cc \
navilink.cc mtk_logger.cc ik3d.cc osm.cc destinator.cc exif.cc vidaone.cc \
igo8.cc gopal.cc humminbird.cc mapasia.cc gnav_trl.cc navitel.cc ggv_ovl.cc \
jtr.cc sbp.cc sbn.cc mmo.cc skyforce.cc itracku.cc v900.cc \
pocketfms_bc.cc pocketfms_fp.cc pocketfms_wp.cc naviguide.cc enigma.cc \
vpl.cc teletype.cc jogmap.cc bushnell.cc bushnell_trl.cc wintec_tes.cc \
subrip.cc garmin_xt.cc garmin_fit.cc \
mtk_locus.cc googledir.cc mapbar_track.cc mapfactor.cc f90g_track.cc \
energympro.cc mynav.cc ggv_bin.cc globalsat_sport.cc geojson.cc
DEPRECATED_FMTS=cetus.cc copilot.cc gpspilot.cc magnav.cc psp.cc gcdb.cc quovadis.cc gpilots.cc geoniche.cc palmdoc.cc hsa_ndv.cc coastexp.cc pathaway.cc coto.cc msroute.cc mag_pdb.cc axim_gpb.cc delbin.cc google.cc
DEPRECATED_HEADERS=geo.h quovadis.h
DEPRECATED_SHAPE=pdbfile.cc
# ALL_FMTS=$$MINIMAL_FMTS
FILTERS=position.cc radius.cc duplicate.cc arcdist.cc polygon.cc smplrout.cc \
reverse_route.cc sort.cc stackfilter.cc trackfilter.cc discard.cc \
nukedata.cc interpolate.cc transform.cc height.cc swapdata.cc bend.cc \
validate.cc
FILTER_HEADERS = $$FILTERS
FILTER_HEADERS ~= s/\.cc/.h/g
SHAPE=shapelib/shpopen.c shapelib/dbfopen.c shapelib/safileio.c
ZLIB=zlib/adler32.c zlib/compress.c zlib/crc32.c zlib/deflate.c zlib/inffast.c \
zlib/inflate.c zlib/infback.c zlib/inftrees.c zlib/trees.c \
zlib/uncompr.c zlib/gzlib.c zlib/gzclose.c zlib/gzread.c \
zlib/gzwrite.c zlib/zutil.c
JEEPS += jeeps/gpsapp.cc jeeps/gpscom.cc \
jeeps/gpsmath.cc jeeps/gpsmem.cc \
jeeps/gpsprot.cc jeeps/gpsread.cc \
jeeps/gpsdevice.cc jeeps/gpsdevice_ser.cc jeeps/gpsdevice_usb.cc \
jeeps/gpsrqst.cc jeeps/gpssend.cc jeeps/gpsserial.cc jeeps/jgpsutil.cc \
jeeps/gpsusbread.cc jeeps/gpsusbsend.cc \
jeeps/gpsusbcommon.cc
SUPPORT = route.cc waypt.cc filter_vecs.cc util.cc vecs.cc mkshort.cc \
csv_util.cc strptime.c grtcirc.cc util_crc.cc xmlgeneric.cc \
formspec.cc xmltag.cc cet.cc cet_util.cc fatal.cc rgbcolors.cc \
inifile.cc garmin_fs.cc units.cc gbser.cc \
gbfile.cc parse.cc session.cc main.cc globals.cc \
src/core/textstream.cc \
src/core/usasciicodec.cc \
src/core/xmlstreamwriter.cc
HEADERS = \
an1sym.h \
cet.h \
cet/ansi_x3_4_1968.h \
cet/cp1252.h \
cet/iso_8859_8.h \
cet_util.h \
csv_util.h \
defs.h \
explorist_ini.h \
filter.h \
filterdefs.h \
garmin_device_xml.h \
garmin_fs.h \
garmin_gpi.h \
garmin_tables.h \
gbfile.h \
gbser.h \
gbser_private.h \
gbversion.h \
grtcirc.h \
heightgrid.h \
holux.h \
inifile.h \
jeeps/garminusb.h \
jeeps/gps.h \
jeeps/gpsapp.h \
jeeps/gpscom.h \
jeeps/gpsdatum.h \
jeeps/gpsdevice.h \
jeeps/gpsfmt.h \
jeeps/gpsmath.h \
jeeps/gpsmem.h \
jeeps/gpsport.h \
jeeps/gpsprot.h \
jeeps/gpsread.h \
jeeps/gpsrqst.h \
jeeps/gpssend.h \
jeeps/gpsserial.h \
jeeps/gpsusbcommon.h \
jeeps/gpsusbint.h \
jeeps/gpsutil.h \
magellan.h \
mapsend.h \
navilink.h \
session.h \
shapelib/shapefil.h \
strptime.h \
xcsv.h \
xmlgeneric.h \
zlib/crc32.h \
zlib/deflate.h \
zlib/gzguts.h \
zlib/inffast.h \
zlib/inffixed.h \
zlib/inflate.h \
zlib/inftrees.h \
zlib/trees.h \
zlib/zconf.h \
zlib/zlib.h \
zlib/zutil.h \
src/core/datetime.h \
src/core/file.h \
src/core/logging.h \
src/core/textstream.h \
src/core/usasciicodec.h \
src/core/xmlstreamwriter.h \
src/core/xmltag.h
HEADERS += $$FILTER_HEADERS
INCLUDEPATH += zlib
load(configure)
CONFIG(release, debug|release): DEFINES *= NDEBUG
macx|linux {
qtCompileTest(unistd) {
# this is used by zlib
DEFINES += HAVE_UNISTD_H
}
qtCompileTest(stdarg) {
# this is used by zlib
DEFINES += HAVE_STDARG_H
}
DEFINES += HAVE_LIBUSB
SOURCES += gbser_posix.cc
HEADERS += gbser_posix.h
JEEPS += jeeps/gpslibusb.cc
INCLUDEPATH += jeeps
}
win32 {
DEFINES += __WIN32__ _CONSOLE
DEFINES -= UNICODE ZLIB_INHIBITED
CONFIG(debug, debug|release) {
DEFINES += _DEBUG
}
SOURCES += gbser_win.cc
HEADERS += gbser_win.h
JEEPS += jeeps/gpsusbwin.cc
LIBS += "-lsetupapi"
}
win32-msvc* {
DEFINES += _CRT_SECURE_NO_DEPRECATE
QMAKE_CXXFLAGS += /MP -wd4100
}
linux {
DEFINES += HAVE_LINUX_HID
LIBS += "-lusb"
}
macx {
LIBS += -framework IOKit -framework CoreFoundation
INCLUDEPATH += mac/libusb
SOURCES += mac/libusb/darwin.c \
mac/libusb/descriptors.c \
mac/libusb/error.c \
mac/libusb/usb.c
HEADERS += mac/libusb/error.h \
mac/libusb/usb.h \
mac/libusb/usbi.h
}
SOURCES += $$ALL_FMTS $$FILTERS $$SUPPORT $$SHAPE $$ZLIB $$JEEPS
DEFINES += NEW_STRINGS
# We don't care about stripping things out of the build. Full monty, baby.
DEFINES += MAXIMAL_ENABLED
DEFINES += FILTERS_ENABLED
DEFINES += SHAPELIB_ENABLED
DEFINES += CSVFMTS_ENABLED
# Creator insists on adding -W to -Wall which results in a completely
# absurd amount of jibber-jabber on perfectly legally formed code.
# Rather than wade through a thousand lines of yammer, let's just nuke -W
# but leave -Wall, which actually has useful stuff.
# Citation: http://stackoverflow.com/questions/18667291/disable-wall-compiler-warnings-in-a-qt-project
QMAKE_CFLAGS_WARN_ON -= -W
QMAKE_CXXFLAGS_WARN_ON -= -W
macx|linux{
check.commands = PNAME=./$(TARGET) ./testo
check.depends = $(TARGET)
QMAKE_EXTRA_TARGETS += check
}
# build the compilation data base used by clang tools including clang-tidy.
macx|linux{
compile_command_database.target = compile_commands.json
compile_command_database.commands = make clean; bear make
QMAKE_EXTRA_TARGETS += compile_command_database
}
# run clang-tidy
# example usage:
# make clang-tidy RUN_CLANG_TIDY_FLAGS="-header-filter=.*\\\.h -checks=-*,modernize-use-nullptr -fix"
# It seems to be better to use run-clang-tidy with the compilation database as opposed to
# running clang-tidy directly and listing the
# compilation options on the clang-tidy line after --.
# An example is modernize-use-override which inserts repeadted overrides when run directly,
# but works as expected when run with run-clang-tidy.
clang-tidy.commands = run-clang-tidy.py $(RUN_CLANG_TIDY_FLAGS)
clang-tidy.depends = compile_commands.json
QMAKE_EXTRA_TARGETS += clang-tidy
# generate coverage report for codacy
# must use gcc, g++
# dependencies:
# extra ubuntu bionic packages: gcovr lcov
linux{
coverage.commands = make clean;
coverage.commands += rm -f gpsbabel_coverage.xml;
coverage.commands += ln -sf GPSBabel gpsbabel;
coverage.commands += $(MAKE) CFLAGS=\"$(CFLAGS) -fprofile-arcs -ftest-coverage\" CXXFLAGS=\"$(CXXFLAGS) -fprofile-arcs -ftest-coverage\" LFLAGS=\"$(LFLAGS) --coverage\" &&
coverage.commands += ./testo &&
coverage.commands += gcov -r -o . $(SOURCES) &&
coverage.commands += gcovr -k -r . --xml --exclude='zlib/*' --exclude='shapelib/*' -o gpsbabel_coverage.xml;
coverage.commands += lcov --capture --directory . --no-external --output-file coverage.info;
coverage.commands += genhtml coverage.info --output-directory coverage_report;
QMAKE_EXTRA_TARGETS += coverage
}
cppcheck.commands = cppcheck --enable=all --force --config-exclude=zlib --config-exclude=shapelib $(INCPATH) $$ALL_FMTS $$FILTERS $$SUPPORT $$JEEPS
QMAKE_EXTRA_TARGETS += cppcheck