From 79b36345cdb9b550ec9687ff810398979c5ba089 Mon Sep 17 00:00:00 2001 From: peak3d Date: Wed, 3 Jun 2020 20:29:44 +0200 Subject: [PATCH] [Backport] Insert VERSION_CODE into full kodi version string --- cmake/KodiConfig.cmake.in | 1 + xbmc/CompileInfo.cpp.in | 5 +++++ xbmc/CompileInfo.h | 1 + xbmc/utils/SystemInfo.cpp | 3 ++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cmake/KodiConfig.cmake.in b/cmake/KodiConfig.cmake.in index 560374dd4b92f..7fd008b320555 100644 --- a/cmake/KodiConfig.cmake.in +++ b/cmake/KodiConfig.cmake.in @@ -4,6 +4,7 @@ set(APP_NAME_UC @APP_NAME_UC@) set(APP_PACKAGE @APP_PACKAGE@) set(APP_VERSION_MAJOR @APP_VERSION_MAJOR@) set(APP_VERSION_MINOR @APP_VERSION_MINOR@) +set(APP_VERSION_CODE @APP_VERSION_CODE@) if(NOT @APP_NAME_UC@_PREFIX) set(@APP_NAME_UC@_PREFIX @APP_PREFIX@) endif() diff --git a/xbmc/CompileInfo.cpp.in b/xbmc/CompileInfo.cpp.in index c47e6cc594dc6..ba4a11c7f6f87 100644 --- a/xbmc/CompileInfo.cpp.in +++ b/xbmc/CompileInfo.cpp.in @@ -70,3 +70,8 @@ std::string CCompileInfo::GetBuildDate() } return "1970-01-01"; } + +const char* CCompileInfo::GetVersionCode() +{ + return "@APP_VERSION_CODE@"; +} diff --git a/xbmc/CompileInfo.h b/xbmc/CompileInfo.h index db3cfbe0f2848..8190c950157f1 100644 --- a/xbmc/CompileInfo.h +++ b/xbmc/CompileInfo.h @@ -22,4 +22,5 @@ class CCompileInfo static const char* GetSCMID(); // Git Revision static const char* GetCopyrightYears(); static std::string GetBuildDate(); + static const char* GetVersionCode(); }; diff --git a/xbmc/utils/SystemInfo.cpp b/xbmc/utils/SystemInfo.cpp index df5e043a3a5a9..f14d1e8ada526 100644 --- a/xbmc/utils/SystemInfo.cpp +++ b/xbmc/utils/SystemInfo.cpp @@ -1238,7 +1238,8 @@ std::string CSysInfo::GetVersionShort() std::string CSysInfo::GetVersion() { - return GetVersionShort() + " Git:" + CCompileInfo::GetSCMID(); + return GetVersionShort() + " (" + CCompileInfo::GetVersionCode() + ")" + + " Git:" + CCompileInfo::GetSCMID(); } std::string CSysInfo::GetBuildDate()