This repository has been archived by the owner on Jan 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbangolufsen.pro
executable file
Β·158 lines (142 loc) Β· 5.58 KB
/
bangolufsen.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
TEMPLATE = lib
CONFIG += c++14 plugin
QT += websockets core quick
# === Version and build information ===========================================
# If built in Buildroot use custom package version, otherwise Git
isEmpty(YIO_BUILD_VERSION) {
GIT_VERSION = "$$system(git describe --match "v[0-9]*" --tags HEAD --always)"
GIT_HASH = "$$system(git log -1 --format="%H")"
GIT_BRANCH = "$$system(git rev-parse --abbrev-ref HEAD)"
} else {
GIT_VERSION = $$YIO_BUILD_VERSION
contains(GIT_VERSION, "^v?(0|[1-9]\d*)\..*") {
# (simplified) version string = regular release
GIT_HASH = ""
GIT_BRANCH = "master"
} else {
# git hash as version = custom build
GIT_HASH = $$YIO_BUILD_VERSION
GIT_BRANCH = ""
}
}
BO_VERSION = $$replace(GIT_VERSION, v, "")
DEFINES += PLUGIN_VERSION=\\\"$$BO_VERSION\\\"
# build timestamp
win32 {
# not the same format as on Unix systems, but good enough...
BUILDDATE=$$system(date /t)
} else {
BUILDDATE=$$system(date +"%Y-%m-%dT%H:%M:%S")
}
# =============================================================================
CONFIG(debug, debug|release) {
DEBUG_BUILD = true
} else {
DEBUG_BUILD = false
}
INTG_LIB_PATH = $$(YIO_SRC)
isEmpty(INTG_LIB_PATH) {
INTG_LIB_PATH = $$clean_path($$PWD/../integrations.library)
message("Environment variables YIO_SRC not defined! Using '$$INTG_LIB_PATH' for integrations.library project.")
} else {
INTG_LIB_PATH = $$(YIO_SRC)/integrations.library
message("YIO_SRC is set: using '$$INTG_LIB_PATH' for integrations.library project.")
}
! include($$INTG_LIB_PATH/qmake-destination-path.pri) {
error( "Couldn't find the qmake-destination-path.pri file!" )
}
! include($$INTG_LIB_PATH/yio-plugin-lib.pri) {
error( "Cannot find the yio-plugin-lib.pri file!" )
}
# verify integrations.library version
unix {
INTG_LIB_VERSION = $$system(cat $$PWD/dependencies.cfg | awk '/^integrations.library:/$$system_quote("{print $2}")')
INTG_GIT_VERSION = "$$system(cd $$INTG_LIB_PATH && git describe --match "v[0-9]*" --tags HEAD --always)"
INTG_GIT_BRANCH = "$$system(cd $$INTG_LIB_PATH && git rev-parse --abbrev-ref HEAD)"
message("Required integrations.library version: $$INTG_LIB_VERSION Local version: $$INTG_GIT_VERSION ($$INTG_GIT_BRANCH)")
# this is a simple check but qmake only provides limited tests and 'versionAtLeast' doesn't work with 'v' prefix.
!contains(INTG_GIT_VERSION, $$re_escape($${INTG_LIB_VERSION}).*)) {
!equals(INTG_GIT_BRANCH, $$INTG_LIB_VERSION) {
error("Invalid integrations.library version: \"$$INTG_GIT_VERSION\". Please check out required version \"$$INTG_LIB_VERSION\"")
}
}
} else {
# sorry, no priority...
INTG_LIB_VERSION = "?"
INTG_GIT_VERSION = "?"
}
QMAKE_SUBSTITUTES += bangolufsen.json.in version.txt.in
# output path must be included for the output file from QMAKE_SUBSTITUTES
INCLUDEPATH += $$OUT_PWD
HEADERS += src/bangolufsen.h
SOURCES += src/bangolufsen.cpp
TARGET = bangolufsen
# Configure destination path. DESTDIR is set in qmake-destination-path.pri
DESTDIR = $$DESTDIR/plugins
OBJECTS_DIR = $$PWD/build/$$DESTINATION_PATH/obj
MOC_DIR = $$PWD/build/$$DESTINATION_PATH/moc
RCC_DIR = $$PWD/build/$$DESTINATION_PATH/qrc
UI_DIR = $$PWD/build/$$DESTINATION_PATH/ui
# install
unix {
target.path = /usr/lib
INSTALLS += target
}
DISTFILES += \
dependencies.cfg \
bangolufsen.json.in \
version.txt.in \
README.md
# === start TRANSLATION section =======================================
lupdate_only{
SOURCES = src/bangolufsen.cpp
}
TRANSLATIONS = translations/bg_BG.ts \
translations/ca_ES.ts \
translations/cs_CZ.ts \
translations/da_DK.ts \
translations/de_DE.ts \
translations/el_GR.ts \
translations/en_US.ts \
translations/es_ES.ts \
translations/et_EE.ts \
translations/fi_FI.ts \
translations/fr_CA.ts \
translations/fr_FR.ts \
translations/ga_IE.ts \
translations/hr_HR.ts \
translations/hu_HU.ts \
translations/is_IS.ts \
translations/it_IT.ts \
translations/lt_LT.ts \
translations/lv_LV.ts \
translations/mt_MT.ts \
translations/nl_NL.ts \
translations/no_NO.ts \
translations/pl_PL.ts \
translations/pt_BR.ts \
translations/pt_PT.ts \
translations/ro_RO.ts \
translations/ru_BY.ts \
translations/ru_MD.ts \
translations/ru_RU.ts \
translations/ru_UA.ts \
translations/sk_SK.ts \
translations/sl_SI.ts \
translations/sv_SE.ts \
translations/zh_CN.ts \
translations/zh_TW.ts
#QMAKE_LUPDATE & _LRELEASE vars are set in qmake-destiation-path.pri
!isEmpty(QMAKE_LUPDATE):exists("$$QMAKE_LUPDATE") {
message("Using Qt linguist tools: '$$QMAKE_LUPDATE', '$$QMAKE_LRELEASE'")
command = $$QMAKE_LUPDATE bangolufsen.pro
system($$command) | error("Failed to run: $$command")
command = $$QMAKE_LRELEASE bangolufsen.pro
system($$command) | error("Failed to run: $$command")
} else {
warning("Qt linguist cmd line tools lupdate / lrelease not found: translations will NOT be compiled and build will most likely fail due to missing .qm files!")
}
RESOURCES += \
translations.qrc
# Add setup schema to metadata
CFG_SCHEMA = "$$cat($$PWD/setup-schema.json)"