2013-10-16 02:54:15 +00:00
|
|
|
# Generate the ssrf-version.h file
|
|
|
|
VERSION_FILE = ssrf-version.h
|
2013-10-10 14:07:25 +00:00
|
|
|
macx: VER_OS = darwin
|
|
|
|
unix: !macx: VER_OS = linux
|
|
|
|
win32: VER_OS = win
|
2013-10-07 00:52:34 +00:00
|
|
|
exists(.git/HEAD): {
|
2013-12-03 21:00:21 +00:00
|
|
|
win32: SET_GIT_DIR = set GIT_DIR
|
|
|
|
else: SET_GIT_DIR = GIT_DIR
|
2013-10-07 00:52:34 +00:00
|
|
|
GIT_HEAD = .git/HEAD
|
|
|
|
VERSION_SCRIPT = $$PWD/scripts/get-version
|
2013-10-15 05:43:50 +00:00
|
|
|
# always use linux here -------------------vvv so we get the true full version
|
2013-10-15 09:49:46 +00:00
|
|
|
FULL_VERSION = "`$$VERSION_SCRIPT linux`"
|
2013-11-05 04:01:47 +00:00
|
|
|
PRODVERSION_STRING = $$system("sh scripts/get-version win $$FULL_VERSION || $${VERSION}.0.0")
|
|
|
|
VERSION_STRING = $$system("sh scripts/get-version linux $$FULL_VERSION || $${VERSION}")
|
2013-12-03 21:00:21 +00:00
|
|
|
version_h.depends = $$VERSION_SCRIPT $$PWD/.git/$$system("$$SET_GIT_DIR=$$PWD/.git git rev-parse --symbolic-full-name HEAD")
|
2013-10-16 03:29:23 +00:00
|
|
|
version_h.commands = echo \\$${LITERAL_HASH}define VERSION_STRING \\\"`GIT_DIR=$$PWD/.git $$VERSION_SCRIPT $$VER_OS`\\\" > ${QMAKE_FILE_OUT}
|
2013-10-07 00:52:34 +00:00
|
|
|
version_h.input = GIT_HEAD
|
|
|
|
version_h.output = $$VERSION_FILE
|
|
|
|
version_h.variable_out = GENERATED_FILES
|
|
|
|
version_h.CONFIG = ignore_no_exist
|
|
|
|
QMAKE_EXTRA_COMPILERS += version_h
|
|
|
|
} else {
|
|
|
|
# This is probably a package
|
2013-10-15 05:39:29 +00:00
|
|
|
FULL_VERSION = $$VERSION
|
2013-10-07 00:52:34 +00:00
|
|
|
system(echo \\$${LITERAL_HASH}define VERSION_STRING \\\"$$VERSION\\\" > $$VERSION_FILE)
|
|
|
|
}
|