-
Notifications
You must be signed in to change notification settings - Fork 2
/
version.pri
42 lines (38 loc) · 1.44 KB
/
version.pri
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
APP_VERSION = 0.6
APP_REVISION = $(shell hg identify -i)
#uncomment the below line in a source package and fill-in the correct revision
#APP_REVISION = <rev-hash>@
ver_info {
APP_VERSION_FILE = version.cpp
revtarget.target = $$APP_VERSION_FILE
win32:revtarget.commands = echo "const char *version = \"$$APP_VERSION\";" \
"const char *revision = \"$$APP_REVISION\";" \
> $$APP_VERSION_FILE
unix:revtarget.commands = echo \
"\"const char *version = \\\"$$APP_VERSION\\\";" \
"const char *revision = \\\"$$APP_REVISION\\\";\"" \
> $$APP_VERSION_FILE
revtarget.depends = $$SOURCES $$HEADERS $$FORMS $$POST_TARGETDEPS
SOURCES += $$APP_VERSION_FILE
QMAKE_EXTRA_TARGETS += revtarget
POST_TARGETDEPS += $$APP_VERSION_FILE
QMAKE_DISTCLEAN += $$APP_VERSION_FILE
}
pkg_info {
PKG_INFO_FILE = pkg_info.json
pkginfo.target = $$PKG_INFO_FILE
pkginfo.CONFIG = recursive
win32:pkginfo.commands = echo "{" \
" \"version\": \"$$APP_VERSION\"," \
" \"revision\": \"$$APP_REVISION\"" \
"}" \
> $$PKG_INFO_FILE
unix:pkginfo.commands = echo "\"{" \
" \\\"version\\\": \\\"$$APP_VERSION\\\"," \
" \\\"revision\\\": \\\"$$APP_REVISION\\\"" \
"}\"" \
> $$PKG_INFO_FILE
QMAKE_EXTRA_TARGETS += pkginfo
POST_TARGETDEPS += $$PKG_INFO_FILE
QMAKE_DISTCLEAN += $$PKG_INFO_FILE
}