qmake: use a dedicated build script to generate ssrf-version.h

- added ./scripts/write-version
- subsurface-gen-version.pri is much simpler now
- .git/HEAD is no longer used explicitly in .pro/.pri files
- the version_h rule is called on each 'make' invocation
but recompilation will occur only if ssrf-version.h
is updated by ./scripts/write-version
- qmake now depends on the existence of ssrf-version.h
so it creates an empty one on Makefile generation so
that a warning is not shown

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2015-01-30 18:56:12 +02:00 committed by Dirk Hohndel
parent 27b4d10f91
commit f6dbed1fc6
3 changed files with 65 additions and 36 deletions

View file

@ -20,8 +20,12 @@ else: TARGET = subsurface
QMAKE_CLEAN += $$TARGET
VERSION = 4.4
VERSION_FILE = $$OUT_PWD/ssrf-version.h
# create a blank VERSION_FILE if missing
system(cat $$VERSION_FILE > /dev/null 2>&1 || touch $$VERSION_FILE)
HEADERS = \
$$VERSION_FILE \
cochran.h \
color.h \
deco.h \