从git读取版本
This commit is contained in:
+20
@@ -18,6 +18,26 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
|
||||
|
||||
# 获取当前的版本号,分支等
|
||||
exists (../.git) {
|
||||
GIT_HEAD = $$system(git rev-list --tags --max-count=1)
|
||||
GIT_TAG = $$system(git describe --tags $${GIT_HEAD})
|
||||
GIT_BRANCH = $$system(git rev-parse --abbrev-ref HEAD)
|
||||
GIT_TIME = $$system(git show --oneline --format=\"%ci%H\" -s HEAD)
|
||||
|
||||
APP_VERSION = "$${GIT_TAG} $${GIT_BRANCH} $${GIT_TIME}"
|
||||
} else {
|
||||
APP_VERSION = None
|
||||
}
|
||||
|
||||
DEFINES += APP_VERSION=\"\\\"$$APP_VERSION\\\"\"
|
||||
|
||||
msvc {
|
||||
QMAKE_CFLAGS += /utf-8
|
||||
QMAKE_CXXFLAGS += /utf-8
|
||||
}
|
||||
|
||||
|
||||
include(./ComponentUI/ComponentUI.pri)
|
||||
|
||||
include (./ToolsUI/ToolsUI.pri)
|
||||
|
||||
Reference in New Issue
Block a user