From 64016fc8ff1b81fd4ca9ea343d178adf21baaa9b Mon Sep 17 00:00:00 2001 From: Xian Nox Date: Wed, 18 Dec 2013 17:35:21 +0100 Subject: [PATCH] Added switch to get git hash and branch name --- qcma.pro | 13 ++++++++----- src/mainwidget.cpp | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/qcma.pro b/qcma.pro index 8e74f46..e68885d 100644 --- a/qcma.pro +++ b/qcma.pro @@ -90,13 +90,16 @@ TRANSLATIONS += \ VERSION = \\\"'0.2.5'\\\" -unix { - DEFINES += "BUILD_HASH=\"\\\"$$system(git rev-parse --short HEAD)\\\"\"" - DEFINES += "BUILD_BRANCH=\"\\\"$$system(git rev-parse --abbrev-ref HEAD)\\\"\"" -} - DEFINES += "QCMA_VER=$${VERSION}" +GET_HASHES { + message("Retrieving git hashes") + unix { + DEFINES += "QCMA_BUILD_HASH=\"\\\"$$system(git rev-parse --short HEAD)\\\"\"" + DEFINES += "QCMA_BUILD_BRANCH=\"\\\"$$system(git rev-parse --abbrev-ref HEAD)\\\"\"" + } +} + unix { isEmpty(PREFIX) { PREFIX = /usr/local diff --git a/src/mainwidget.cpp b/src/mainwidget.cpp index 6424512..cacf6b5 100644 --- a/src/mainwidget.cpp +++ b/src/mainwidget.cpp @@ -134,7 +134,7 @@ void MainWidget::showAboutDialog() about.setText(QString("QCMA ") + QCMA_VER); about.setWindowTitle(tr("About QCMA")); -#ifndef BUILD_HASH +#ifndef QCMA_BUILD_HASH about.setInformativeText(tr("Copyright (C) 2013 Codestation") + "\n"); #else about.setInformativeText(tr("Copyright (C) 2013 Codestation\n\nbuild hash: %1\nbuild branch: %2").arg(BUILD_HASH).arg(BUILD_BRANCH));