-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathnavdatareader.pro
248 lines (206 loc) · 8.9 KB
/
navdatareader.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
#*****************************************************************************
# Copyright 2015-2020 Alexander Barthel [email protected]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#****************************************************************************
# =============================================================================
# Set these environment variables for configuration - do not change this .pro file
# =============================================================================
#
# ATOOLS_INC_PATH
# Optional. Path to atools include. Default is "../atools/src" if not set.
# Also reads *.qm translation files from "$ATOOLS_INC_PATH/..".
#
# ATOOLS_LIB_PATH
# Optional. Path to atools static library. Default is "../build-atools-$${CONF_TYPE}"
# ("../build-atools-$${CONF_TYPE}/$${CONF_TYPE}" on Windows) if not set.
#
# ATOOLS_GIT_PATH
# Optional. Path to GIT executable. Revision will be set to "UNKNOWN" if not set.
# Uses "git" on macOS and Linux as default if not set.
# Example: "C:\Git\bin\git"
#
# DEPLOY_BASE
# Optional. Target folder for "make deploy". Default is "../deploy" plus project name ($$TARGET_NAME).
#
# ATOOLS_QUIET
# Optional. Set this to "true" to avoid qmake messages.
#
# =============================================================================
# End of configuration documentation
# =============================================================================
# Define program version here VERSION_NUMBER_TODO
VERSION_NUMBER=1.1.0.develop
QT += sql core
CONFIG += build_all c++14 console
CONFIG -= app_bundle gui debug_and_release debug_and_release_target
TARGET = navdatareader
TEMPLATE = app
TARGET_NAME=Navdatareader
# =======================================================================
# Copy environment variables into qmake variables
ATOOLS_INC_PATH=$$(ATOOLS_INC_PATH)
ATOOLS_LIB_PATH=$$(ATOOLS_LIB_PATH)
GIT_PATH=$$(ATOOLS_GIT_PATH)
DEPLOY_BASE=$$(DEPLOY_BASE)
QUIET=$$(ATOOLS_QUIET)
# =======================================================================
# Fill defaults for unset
CONFIG(debug, debug|release) : CONF_TYPE=debug
CONFIG(release, debug|release) : CONF_TYPE=release
isEmpty(DEPLOY_BASE) : DEPLOY_BASE=$$PWD/../deploy
isEmpty(ATOOLS_INC_PATH) : ATOOLS_INC_PATH=$$PWD/../atools/src
isEmpty(ATOOLS_LIB_PATH) : ATOOLS_LIB_PATH=$$PWD/../build-atools-$$CONF_TYPE
# =======================================================================
# Set compiler flags and paths
unix:!macx {
isEmpty(GIT_PATH) : GIT_PATH=git
QMAKE_LFLAGS += -no-pie
# Makes the shell script and setting LD_LIBRARY_PATH redundant
QMAKE_RPATHDIR=.
QMAKE_RPATHDIR+=./lib
}
win32 {
WINDEPLOY_FLAGS = --compiler-runtime
CONFIG(debug, debug|release) : WINDEPLOY_FLAGS += --debug
# CONFIG(release, debug|release) : WINDEPLOY_FLAGS += --release
}
macx {
isEmpty(GIT_PATH) : GIT_PATH=git
# Compatibility down to OS X Sierra 10.12 inclusive
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
}
isEmpty(GIT_PATH) {
GIT_REVISION=UNKNOWN
GIT_REVISION_FULL=UNKNOWN
} else {
GIT_REVISION=$$system('$$GIT_PATH' rev-parse --short HEAD)
GIT_REVISION_FULL=$$system('$$GIT_PATH' rev-parse HEAD)
}
LIBS += -L$$ATOOLS_LIB_PATH -latools
PRE_TARGETDEPS += $$ATOOLS_LIB_PATH/libatools.a
DEPENDPATH += $$ATOOLS_INC_PATH
INCLUDEPATH += $$PWD/src $$ATOOLS_INC_PATH
DEFINES += VERSION_NUMBER_NAVDATAREADER='\\"$$VERSION_NUMBER\\"'
DEFINES += GIT_REVISION_NAVDATAREADER='\\"$$GIT_REVISION\\"'
DEFINES += QT_NO_CAST_FROM_BYTEARRAY
DEFINES += QT_NO_CAST_TO_ASCII
# =======================================================================
# Include build_options.pro with additional variables
exists($$PWD/../build_options.pro) {
include($$PWD/../build_options.pro)
!isEqual(QUIET, "true") {
message($$PWD/../build_options.pro found.)
}
} else {
!isEqual(QUIET, "true") {
message($$PWD/../build_options.pro not found.)
}
}
# =======================================================================
# Print values when running qmake
!isEqual(QUIET, "true") {
message(-----------------------------------)
message(VERSION_NUMBER: $$VERSION_NUMBER)
message(GIT_REVISION: $$GIT_REVISION)
message(GIT_REVISION_FULL: $$GIT_REVISION_FULL)
message(GIT_PATH: $$GIT_PATH)
message(ATOOLS_INC_PATH: $$ATOOLS_INC_PATH)
message(ATOOLS_LIB_PATH: $$ATOOLS_LIB_PATH)
message(DEPLOY_BASE: $$DEPLOY_BASE)
message(DEFINES: $$DEFINES)
message(INCLUDEPATH: $$INCLUDEPATH)
message(LIBS: $$LIBS)
message(TARGET_NAME: $$TARGET_NAME)
message(QT_INSTALL_PREFIX: $$[QT_INSTALL_PREFIX])
message(QT_INSTALL_LIBS: $$[QT_INSTALL_LIBS])
message(QT_INSTALL_PLUGINS: $$[QT_INSTALL_PLUGINS])
message(QT_INSTALL_TRANSLATIONS: $$[QT_INSTALL_TRANSLATIONS])
message(QT_INSTALL_BINS: $$[QT_INSTALL_BINS])
message(CONFIG: $$CONFIG)
message(QT: $$QT)
message(-----------------------------------)
}
# =====================================================================
# Files
SOURCES += \
main.cpp \
navdatareader.cpp
HEADERS += \
navdatareader.h
OTHER_FILES += \
$$files(build/*, true) \
$$files(help/*, true) \
$$files(config/*, true) \
.travis.yml \
.gitignore \
BUILD.txt \
CHANGELOG.txt \
LICENSE.txt \
README.txt \
uncrustify.cfg
RESOURCES += \
navdatareader.qrc
# Linux - Copy help and Marble plugins and data
unix:!macx {
copydata.commands += cp -avfu $$PWD/help $$OUT_PWD
}
# Linux specific deploy target
unix:!macx {
DEPLOY_DIR=\"$$DEPLOY_BASE/$$TARGET_NAME\"
DEPLOY_DIR_LIB=\"$$DEPLOY_BASE/$$TARGET_NAME/lib\"
deploy.commands = rm -Rfv $$DEPLOY_DIR &&
deploy.commands += mkdir -pv $$DEPLOY_DIR_LIB &&
deploy.commands += mkdir -pv $$DEPLOY_DIR/sqldrivers &&
deploy.commands += echo $$VERSION_NUMBER > $$DEPLOY_DIR/version.txt &&
deploy.commands += echo $$GIT_REVISION_FULL > $$DEPLOY_DIR/revision.txt &&
deploy.commands += cp -Rvf $$OUT_PWD/navdatareader $$DEPLOY_DIR &&
deploy.commands += cp -Rvf $$OUT_PWD/help $$DEPLOY_DIR &&
deploy.commands += cp -Rvf $$PWD/resources/config $$DEPLOY_DIR/config &&
deploy.commands += cp -vf $$PWD/CHANGELOG.txt $$DEPLOY_DIR &&
deploy.commands += cp -vf $$PWD/README.txt $$DEPLOY_DIR &&
deploy.commands += cp -vf $$PWD/LICENSE.txt $$DEPLOY_DIR &&
deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/sqldrivers/libqsqlite.so* $$DEPLOY_DIR/sqldrivers &&
deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libicudata.so* $$DEPLOY_DIR_LIB &&
deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libicui18n.so* $$DEPLOY_DIR_LIB &&
deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libicuuc.so* $$DEPLOY_DIR_LIB &&
deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5Gui.so* $$DEPLOY_DIR_LIB &&
deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5Core.so* $$DEPLOY_DIR_LIB &&
deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5Sql.so* $$DEPLOY_DIR_LIB
}
# Windows specific deploy target only for release builds
win32 {
defineReplace(p){return ($$shell_quote($$shell_path($$1)))}
deploy.commands = rmdir /s /q $$p($$DEPLOY_BASE/$$TARGET_NAME) &
deploy.commands += mkdir $$p($$DEPLOY_BASE/$$TARGET_NAME/sqldrivers) &&
deploy.commands += echo $$VERSION_NUMBER > $$p($$DEPLOY_BASE/$$TARGET_NAME/version.txt) &&
deploy.commands += echo $$GIT_REVISION_FULL > $$p($$DEPLOY_BASE/$$TARGET_NAME/revision.txt) &&
deploy.commands += xcopy $$p($$OUT_PWD/navdatareader.exe) $$p($$DEPLOY_BASE/$$TARGET_NAME) &&
deploy.commands += xcopy $$p($$PWD/CHANGELOG.txt) $$p($$DEPLOY_BASE/$$TARGET_NAME) &&
deploy.commands += xcopy $$p($$PWD/README.txt) $$p($$DEPLOY_BASE/$$TARGET_NAME) &&
deploy.commands += xcopy $$p($$PWD/LICENSE.txt) $$p($$DEPLOY_BASE/$$TARGET_NAME) &&
deploy.commands += xcopy $$p($$[QT_INSTALL_BINS]/libgcc*.dll) $$p($$DEPLOY_BASE/$$TARGET_NAME) &&
deploy.commands += xcopy $$p($$[QT_INSTALL_BINS]/libstdc*.dll) $$p($$DEPLOY_BASE/$$TARGET_NAME) &&
deploy.commands += xcopy $$p($$[QT_INSTALL_BINS]/libwinpthread*.dll) $$p($$DEPLOY_BASE/$$TARGET_NAME) &&
deploy.commands += xcopy /i /s /e /f /y $$p($$PWD/help) $$p($$DEPLOY_BASE/$$TARGET_NAME/help) &&
deploy.commands += xcopy /i /s /e /f /y $$p($$PWD/resources/config) $$p($$DEPLOY_BASE/$$TARGET_NAME/config) &&
deploy.commands += $$p($$[QT_INSTALL_BINS]/windeployqt) $$WINDEPLOY_FLAGS $$p($$DEPLOY_BASE/$$TARGET_NAME)
}
# =====================================================================
# Additional targets
# Need to copy data when compiling
all.depends = copydata
# Deploy needs compiling before
deploy.depends = all
QMAKE_EXTRA_TARGETS += deploy copydata all