Simplfying the Git commands in the project file
* Allowing commands to get the `GIT_COMMIT_ID`, `GIT_COMMIT_DATE` and `GIT_BRANCH` to work with spaces in path
This commit is contained in:
parent
86f0ab888d
commit
d67acee002
1 changed files with 3 additions and 3 deletions
|
|
@ -43,9 +43,9 @@ TEMPLATE = app
|
|||
#-----------------------------------------------------------------------------------------------#
|
||||
win32:BUILDDATE = $$system(date /t)
|
||||
unix:BUILDDATE = $$system(date -R -d "@${SOURCE_DATE_EPOCH:-$(date +%s)}")
|
||||
GIT_COMMIT_ID = $$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ rev-parse HEAD)
|
||||
GIT_COMMIT_DATE = $$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ show -s --format=%ci HEAD)
|
||||
GIT_BRANCH = $$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ rev-parse --abbrev-ref HEAD)
|
||||
GIT_COMMIT_ID = $$system(git log -n 1 --pretty=format:"%H")
|
||||
GIT_COMMIT_DATE = $$system(git log -n 1 --pretty=format:"%ci")
|
||||
GIT_BRANCH = $$system(git branch --show-current)
|
||||
|
||||
DEFINES += \
|
||||
VERSION_STRING=\\"\"\"$$VERSION\\"\"\" \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue