2013-10-07 00:52:34 +00:00
|
|
|
# Generate the version.h file
|
|
|
|
VERSION_FILE = 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): {
|
|
|
|
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-10-15 10:49:48 +00:00
|
|
|
version_h.depends = $$VERSION_SCRIPT $$system(sed \'s/ref: \\(.*\\)/.git\\/\\1/\' $$GIT_HEAD)
|
2013-10-10 14:07:25 +00:00
|
|
|
version_h.commands = echo \\$${LITERAL_HASH}define VERSION_STRING \\\"`$$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)
|
|
|
|
}
|