Если планируется брать версию из ГИТ-а автоматом, то можно сделать gitversion.pri файл с примерно таким содержимым:
# We need to specify a path to the Git executable file
# from the environment varable here. Because when on
# Windows this path is in the global system environment
# variable PATH, then the compilation fails due to the
# "git\bin\sh.exe" which too is visible from that global
# PATH.
ENV_GIT_EXE_PATH = $$(GIT_EXE_PATH)
isEmpty(ENV_GIT_EXE_PATH) {
ENV_GIT_EXE_PATH = git
message("Environment variable GIT_EXE_PATH is not detected, use default Git name")
} else {
ENV_GIT_EXE_PATH = $$shell_quote($$shell_path($$ENV_GIT_EXE_PATH))
message("A Git path is $$ENV_GIT_EXE_PATH")
}
GIT_VERSION = $$system($$ENV_GIT_EXE_PATH describe --long)
message("GIT_VERSION=$$GIT_VERSION")
VERSION = $$GIT_VERSION
VERSION ~= s/^v|-\d+-g[a-f0-9]{6,}//
# Now we use an 'incremental' build numering, e.g. due to the
# Google Play versioning restrictions. In our case this is a
# number of all commits from the head.
BUILD_NUMBER = $$system($$ENV_GIT_EXE_PATH rev-list --count HEAD)
# On Windows the application version has an
# extended format with a four numbers.
win32:VERSION = $$VERSION'.'$$BUILD_NUMBER
message("VERSION = $$VERSION")
message("BUILD_NUMBER = $$BUILD_NUMBER")
DEFINES += GIT_VERSION=\\\"$$GIT_VERSION\\\"
и подключать его в проекте.
UPD: А по теме скорее всего вызывать что-то надо через $$system()