-
Notifications
You must be signed in to change notification settings - Fork 4
/
harbour-matkakortti.pro
306 lines (240 loc) · 7.22 KB
/
harbour-matkakortti.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
NAME = matkakortti
PREFIX = harbour
TARGET = $${PREFIX}-$${NAME}
CONFIG += sailfishapp link_pkgconfig
PKGCONFIG += sailfishapp glib-2.0 gobject-2.0 gio-unix-2.0
QT += qml quick dbus
DEFINES += NFCDC_NEED_PEER_SERVICE=0
QMAKE_CXXFLAGS += -Wno-unused-parameter
QMAKE_CFLAGS += -Wno-unused-parameter
LIBS += -ldl
TARGET_DATA_DIR = /usr/share/$${TARGET}
app_settings {
# This path is hardcoded in jolla-settings
TRANSLATIONS_PATH = /usr/share/translations
} else {
TRANSLATIONS_PATH = $${TARGET_DATA_DIR}/translations
}
CONFIG(debug, debug|release) {
DEFINES += DEBUG HARBOUR_DEBUG
} else {
QMAKE_CXXFLAGS += -flto -fPIC
QMAKE_CFLAGS += -flto -fPIC
QMAKE_LFLAGS += -flto -fPIC
}
# Directories
HARBOUR_LIB_DIR = $${_PRO_FILE_PWD_}/harbour-lib
LIBGLIBUTIL_DIR = $${_PRO_FILE_PWD_}/libglibutil
LIBGNFCDC_DIR = $${_PRO_FILE_PWD_}/libgnfcdc
LIBQNFCDC_DIR = $${_PRO_FILE_PWD_}/libqnfcdc
# Files
OTHER_FILES += \
LICENSE \
README.md \
rpm/*.spec \
*.desktop \
qml/*.qml \
qml/images/*.svg \
qml/components/*.js \
qml/components/*.qml \
icons/*.svg \
translations/*.ts
# libglibutil
LIBGLIBUTIL_SRC = $${LIBGLIBUTIL_DIR}/src
LIBGLIBUTIL_INCLUDE = $${LIBGLIBUTIL_DIR}/include
INCLUDEPATH += \
$${LIBGLIBUTIL_INCLUDE}
HEADERS += \
$${LIBGLIBUTIL_INCLUDE}/*.h
SOURCES += \
$${LIBGLIBUTIL_SRC}/gutil_log.c \
$${LIBGLIBUTIL_SRC}/gutil_misc.c \
$${LIBGLIBUTIL_SRC}/gutil_strv.c \
$${LIBGLIBUTIL_SRC}/gutil_timenotify.c
# libgnfcdc
LIBGNFCDC_INCLUDE = $${LIBGNFCDC_DIR}/include
LIBGNFCDC_SRC = $${LIBGNFCDC_DIR}/src
LIBGNFCDC_SPEC = $${LIBGNFCDC_DIR}/spec
INCLUDEPATH += \
$${LIBGNFCDC_INCLUDE}
HEADERS += \
$${LIBGNFCDC_INCLUDE}/*.h \
$${LIBGNFCDC_SRC}/*.h
SOURCES += \
$${LIBGNFCDC_SRC}/nfcdc_adapter.c \
$${LIBGNFCDC_SRC}/nfcdc_base.c \
$${LIBGNFCDC_SRC}/nfcdc_daemon.c \
$${LIBGNFCDC_SRC}/nfcdc_default_adapter.c \
$${LIBGNFCDC_SRC}/nfcdc_error.c \
$${LIBGNFCDC_SRC}/nfcdc_isodep.c \
$${LIBGNFCDC_SRC}/nfcdc_log.c \
$${LIBGNFCDC_SRC}/nfcdc_tag.c \
$${LIBGNFCDC_SRC}/nfcdc_util.c
OTHER_FILES += \
$${LIBGNFCDC_SPEC}/*.xml
defineTest(generateStub) {
xml = $${LIBGNFCDC_SPEC}/org.sailfishos.nfc.$${1}.xml
cmd = gdbus-codegen --generate-c-code org.sailfishos.nfc.$${1} $${xml}
gen_h = org.sailfishos.nfc.$${1}.h
gen_c = org.sailfishos.nfc.$${1}.c
target_h = org_sailfishos_nfc_$${1}_h
target_c = org_sailfishos_nfc_$${1}_c
$${target_h}.target = $${gen_h}
$${target_h}.depends = $${xml}
$${target_h}.commands = $${cmd}
export($${target_h}.target)
export($${target_h}.depends)
export($${target_h}.commands)
GENERATED_HEADERS += $${gen_h}
PRE_TARGETDEPS += $${gen_h}
QMAKE_EXTRA_TARGETS += $${target_h}
$${target_c}.target = $${gen_c}
$${target_c}.depends = $${gen_h}
export($${target_c}.target)
export($${target_c}.depends)
GENERATED_SOURCES += $${gen_c}
QMAKE_EXTRA_TARGETS += $${target_c}
PRE_TARGETDEPS += $${gen_c}
export(QMAKE_EXTRA_TARGETS)
export(GENERATED_SOURCES)
export(PRE_TARGETDEPS)
}
generateStub(Adapter)
generateStub(Daemon)
generateStub(IsoDep)
generateStub(Settings)
generateStub(Tag)
# libqnfcdc
LIBQNFCDC_INCLUDE = $${LIBQNFCDC_DIR}/include
LIBQNFCDC_SRC = $${LIBQNFCDC_DIR}/src
INCLUDEPATH += \
$${LIBQNFCDC_INCLUDE}
HEADERS += \
$${LIBQNFCDC_INCLUDE}/NfcAdapter.h \
$${LIBQNFCDC_INCLUDE}/NfcMode.h \
$${LIBQNFCDC_INCLUDE}/NfcSystem.h
SOURCES += \
$${LIBQNFCDC_SRC}/NfcAdapter.cpp \
$${LIBQNFCDC_SRC}/NfcMode.cpp \
$${LIBQNFCDC_SRC}/NfcSystem.cpp
# harbour-lib
HARBOUR_LIB_INCLUDE = $${HARBOUR_LIB_DIR}/include
HARBOUR_LIB_SRC = $${HARBOUR_LIB_DIR}/src
HARBOUR_LIB_QML = $${HARBOUR_LIB_DIR}/qml
INCLUDEPATH += \
$${HARBOUR_LIB_INCLUDE}
HEADERS += \
$${HARBOUR_LIB_INCLUDE}/HarbourDebug.h \
$${HARBOUR_LIB_INCLUDE}/HarbourSystemTime.h \
$${HARBOUR_LIB_INCLUDE}/HarbourUtil.h
SOURCES += \
$${HARBOUR_LIB_SRC}/HarbourSystemTime.cpp \
$${HARBOUR_LIB_SRC}/HarbourUtil.cpp
HARBOUR_QML_COMPONENTS = \
$${HARBOUR_LIB_QML}/HarbourHighlightIcon.qml
OTHER_FILES += $${HARBOUR_QML_COMPONENTS}
qml_components.files = $${HARBOUR_QML_COMPONENTS}
qml_components.path = $${TARGET_DATA_DIR}/qml/harbour
INSTALLS += qml_components
# App
INCLUDEPATH += \
src
HEADERS += \
src/TravelCard.h \
src/TravelCardImpl.h \
src/TravelCardIsoDep.h \
src/Util.h
SOURCES += \
src/main.cpp \
src/TravelCard.cpp \
src/TravelCardIsoDep.cpp \
src/Util.cpp
# HSL
OTHER_FILES += \
qml/hsl/*.qml \
qml/hsl/images/*.svg
HEADERS += \
src/hsl/HslArea.h \
src/hsl/HslCard.h \
src/hsl/HslCardAppInfo.h \
src/hsl/HslCardEticket.h \
src/hsl/HslCardHistory.h \
src/hsl/HslCardPeriodPass.h \
src/hsl/HslCardStoredValue.h \
src/hsl/HslData.h
SOURCES += \
src/hsl/HslArea.cpp \
src/hsl/HslCard.cpp \
src/hsl/HslCardAppInfo.cpp \
src/hsl/HslCardEticket.cpp \
src/hsl/HslCardHistory.cpp \
src/hsl/HslCardPeriodPass.cpp \
src/hsl/HslCardStoredValue.cpp \
src/hsl/HslData.cpp
# Nysse
OTHER_FILES += \
qml/nysse/*.qml \
qml/nysse/images/*.svg
HEADERS += \
src/nysse/NysseCard.h \
src/nysse/NysseCardAppInfo.h \
src/nysse/NysseCardBalance.h \
src/nysse/NysseCardHistory.h \
src/nysse/NysseCardOwnerInfo.h \
src/nysse/NysseCardTicketInfo.h \
src/nysse/NysseUtil.h
SOURCES += \
src/nysse/NysseCard.cpp \
src/nysse/NysseCardAppInfo.cpp \
src/nysse/NysseCardBalance.cpp \
src/nysse/NysseCardHistory.cpp \
src/nysse/NysseCardOwnerInfo.cpp \
src/nysse/NysseCardTicketInfo.cpp \
src/nysse/NysseUtil.cpp
# Icons
ICON_SIZES = 86 108 128 172 256
for(s, ICON_SIZES) {
icon_target = icon_$${s}
icon_dir = icons/$${s}x$${s}
$${icon_target}.files = $${icon_dir}/$${TARGET}.png
$${icon_target}.path = /usr/share/icons/hicolor/$${s}x$${s}/apps
INSTALLS += $${icon_target}
}
# Translations
TRANSLATION_IDBASED=-idbased
TRANSLATION_SOURCES = \
$${_PRO_FILE_PWD_}/qml
defineTest(addTrFile) {
rel = translations/$${1}
OTHER_FILES += $${rel}.ts
export(OTHER_FILES)
in = $${_PRO_FILE_PWD_}/$$rel
out = $${OUT_PWD}/$$rel
s = $$replace(1,-,_)
lupdate_target = lupdate_$$s
qm_target = qm_$$s
$${lupdate_target}.commands = lupdate -noobsolete -locations none $${TRANSLATION_SOURCES} -ts \"$${in}.ts\" && \
mkdir -p \"$${OUT_PWD}/translations\" && [ \"$${in}.ts\" != \"$${out}.ts\" ] && \
cp -af \"$${in}.ts\" \"$${out}.ts\" || :
$${qm_target}.path = $$TRANSLATIONS_PATH
$${qm_target}.depends = $${lupdate_target}
$${qm_target}.commands = lrelease $$TRANSLATION_IDBASED \"$${out}.ts\" && \
$(INSTALL_FILE) \"$${out}.qm\" $(INSTALL_ROOT)$${TRANSLATIONS_PATH}/
QMAKE_EXTRA_TARGETS += $${lupdate_target} $${qm_target}
INSTALLS += $${qm_target}
export($${lupdate_target}.commands)
export($${qm_target}.path)
export($${qm_target}.depends)
export($${qm_target}.commands)
export(QMAKE_EXTRA_TARGETS)
export(INSTALLS)
}
LANGUAGES = fi pl ru sv zh_CN
addTrFile($${TARGET})
for(l, LANGUAGES) {
addTrFile($${TARGET}-$$l)
}
qm.path = $$TRANSLATIONS_PATH
qm.CONFIG += no_check_exist
INSTALLS += qm
OTHER_FILES += LICENSE