From 32e2a5f44c17cfd51e78334e897a2473793d83b8 Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Sun, 17 Oct 2021 21:33:15 +0200 Subject: [PATCH] Add git tag to version info --- CMakeLists.txt | 1 + cmake/version.cpp.in | 4 +++- src/advanced-scene-switcher.cpp | 1 + src/general.cpp | 2 ++ src/headers/version.h | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57215d39..237807ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") include(GetGitRevisionDescription) get_git_head_revision(GIT_REFSPEC GIT_SHA1) +git_describe(GIT_TAG) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/src/version.cpp" @ONLY) diff --git a/cmake/version.cpp.in b/cmake/version.cpp.in index d19cc759..a281c4cc 100644 --- a/cmake/version.cpp.in +++ b/cmake/version.cpp.in @@ -1,3 +1,5 @@ #include "src/headers/version.h" #define GIT_SHA1 "@GIT_SHA1@" -const char g_GIT_SHA1[] = GIT_SHA1; \ No newline at end of file +#define GIT_TAG "@GIT_TAG@" +const char g_GIT_SHA1[] = GIT_SHA1; +const char g_GIT_TAG[] = GIT_TAG; \ No newline at end of file diff --git a/src/advanced-scene-switcher.cpp b/src/advanced-scene-switcher.cpp index ab6182f7..d224ab7b 100644 --- a/src/advanced-scene-switcher.cpp +++ b/src/advanced-scene-switcher.cpp @@ -599,6 +599,7 @@ static void OBSEvent(enum obs_frontend_event event, void *switcher) extern "C" void InitSceneSwitcher() { + blog(LOG_INFO, "version: %s", g_GIT_TAG); blog(LOG_INFO, "version: %s", g_GIT_SHA1); QAction *action = (QAction *)obs_frontend_add_tools_menu_qaction( diff --git a/src/general.cpp b/src/general.cpp index 8ec6011f..fa0c12f1 100644 --- a/src/general.cpp +++ b/src/general.cpp @@ -887,4 +887,6 @@ void AdvSceneSwitcher::setupGeneralTab() QTimer *statusTimer = new QTimer(this); connect(statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); statusTimer->start(1000); + + setWindowTitle(windowTitle() + " - " + g_GIT_TAG); } diff --git a/src/headers/version.h b/src/headers/version.h index 8e02c575..9eeef8a7 100644 --- a/src/headers/version.h +++ b/src/headers/version.h @@ -1 +1,2 @@ extern const char g_GIT_SHA1[]; +extern const char g_GIT_TAG[];