From f9dfc2b5e7315566dee7410c8fa18a9fc891a0ef Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Wed, 20 Dec 2023 16:46:21 +0100 Subject: [PATCH] define git commnds only for linux --- CArunGUI/CArunGUI.pro | 7 ++++--- dCArun/dCArun.pro | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CArunGUI/CArunGUI.pro b/CArunGUI/CArunGUI.pro index 1e34ec4..41050e3 100644 --- a/CArunGUI/CArunGUI.pro +++ b/CArunGUI/CArunGUI.pro @@ -21,14 +21,15 @@ INCLUDEPATH += ../include win32 { BUILD_DATE=$$system("date /t") BUILD_TIME=$$system("time /t") + GIT_COMMIT="" + EXTENDED_VERSION="" } else { BUILD_DATE=$$system("date +%d-%m-%y") 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_BUILD_DATE=\\\"$$BUILD_DATE\\\" diff --git a/dCArun/dCArun.pro b/dCArun/dCArun.pro index 82bfba6..c2f8967 100644 --- a/dCArun/dCArun.pro +++ b/dCArun/dCArun.pro @@ -25,15 +25,16 @@ INCLUDEPATH += ../include win32 { BUILD_DATE=$$system("date /t") BUILD_TIME=$$system("time /t") + GIT_COMMIT="" + EXTENDED_VERSION="" } else { BUILD_DATE=$$system("date +%d-%m-%y") 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_BUILD_DATE=\\\"$$BUILD_DATE\\\" DEFINES+=APP_BUILD_TIME=\\\"$$BUILD_TIME\\\"