define git commnds only for linux

This commit is contained in:
Gerhard Hoffmann 2023-12-20 16:46:21 +01:00
parent fc2abd3e89
commit f9dfc2b5e7
2 changed files with 9 additions and 7 deletions

View File

@ -21,14 +21,15 @@ INCLUDEPATH += ../include
win32 { win32 {
BUILD_DATE=$$system("date /t") BUILD_DATE=$$system("date /t")
BUILD_TIME=$$system("time /t") BUILD_TIME=$$system("time /t")
GIT_COMMIT=""
EXTENDED_VERSION=""
} else { } else {
BUILD_DATE=$$system("date +%d-%m-%y") BUILD_DATE=$$system("date +%d-%m-%y")
BUILD_TIME=$$system("date +%H:%M:%S") BUILD_TIME=$$system("date +%H:%M:%S")
GIT_COMMIT=$$system("git log -1 --format=oneline | cut -d' ' -f1")
EXTENDED_VERSION="$${VERSION}-$${GIT_COMMIT}"
} }
GIT_COMMIT=$$system("git log -1 --format=oneline | cut -d' ' -f1")
EXTENDED_VERSION="$${VERSION}-$${GIT_COMMIT}"
DEFINES+=APP_VERSION=\\\"$$VERSION\\\" DEFINES+=APP_VERSION=\\\"$$VERSION\\\"
DEFINES+=APP_BUILD_DATE=\\\"$$BUILD_DATE\\\" DEFINES+=APP_BUILD_DATE=\\\"$$BUILD_DATE\\\"

View File

@ -25,15 +25,16 @@ INCLUDEPATH += ../include
win32 { win32 {
BUILD_DATE=$$system("date /t") BUILD_DATE=$$system("date /t")
BUILD_TIME=$$system("time /t") BUILD_TIME=$$system("time /t")
GIT_COMMIT=""
EXTENDED_VERSION=""
} else { } else {
BUILD_DATE=$$system("date +%d-%m-%y") BUILD_DATE=$$system("date +%d-%m-%y")
BUILD_TIME=$$system("date +%H:%M:%S") BUILD_TIME=$$system("date +%H:%M:%S")
GIT_COMMIT=$$system("git log -1 --format=oneline | cut -d' ' -f1")
EXTENDED_VERSION="$${VERSION}-$${GIT_COMMIT}"
} }
GIT_COMMIT=$$system("git log -1 --format=oneline | cut -d' ' -f1")
EXTENDED_VERSION="$${VERSION}-$${GIT_COMMIT}"
DEFINES+=APP_VERSION=\\\"$$VERSION\\\" DEFINES+=APP_VERSION=\\\"$$VERSION\\\"
DEFINES+=APP_BUILD_DATE=\\\"$$BUILD_DATE\\\" DEFINES+=APP_BUILD_DATE=\\\"$$BUILD_DATE\\\"
DEFINES+=APP_BUILD_TIME=\\\"$$BUILD_TIME\\\" DEFINES+=APP_BUILD_TIME=\\\"$$BUILD_TIME\\\"