From 41256e0b756f5f08b4d47f962b6af3a4f4487962 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 27 Aug 2024 07:38:53 +0200 Subject: [PATCH] Include build server OS as text in about dialog --- ApplicationLibCode/Adm/RiaVersionInfo.h.cmake | 4 +++- .../ApplicationCommands/RicHelpFeatures.cpp | 2 ++ CMakeLists.txt | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/Adm/RiaVersionInfo.h.cmake b/ApplicationLibCode/Adm/RiaVersionInfo.h.cmake index 8e2910f76a..c710fe6ae7 100644 --- a/ApplicationLibCode/Adm/RiaVersionInfo.h.cmake +++ b/ApplicationLibCode/Adm/RiaVersionInfo.h.cmake @@ -35,4 +35,6 @@ #define RESINSIGHT_PYTHON_VERSION "@Python3_VERSION@" -#define RESINSIGHT_GIT_HASH "@RESINSIGHT_GIT_HASH@" \ No newline at end of file +#define RESINSIGHT_GIT_HASH "@RESINSIGHT_GIT_HASH@" + +#define RESINSIGHT_BUILD_SYSTEM_ID "@RESINSIGHT_BUILD_SYSTEM_ID@" \ No newline at end of file diff --git a/ApplicationLibCode/Commands/ApplicationCommands/RicHelpFeatures.cpp b/ApplicationLibCode/Commands/ApplicationCommands/RicHelpFeatures.cpp index b927d259c2..eecc502e6b 100644 --- a/ApplicationLibCode/Commands/ApplicationCommands/RicHelpFeatures.cpp +++ b/ApplicationLibCode/Commands/ApplicationCommands/RicHelpFeatures.cpp @@ -148,6 +148,8 @@ void RicHelpAboutFeature::onActionTriggered( bool isChecked ) dlg.addVersionEntry( " ", QString( " " ) + vendor + " : " + render ); } + dlg.addVersionEntry( " ", QString( " Build Server : " ) + RESINSIGHT_BUILD_SYSTEM_ID ); + QString compiledUsingPythonVersion = RESINSIGHT_PYTHON_VERSION; if ( !compiledUsingPythonVersion.isEmpty() ) { diff --git a/CMakeLists.txt b/CMakeLists.txt index 4431f8d4f6..a7e68405de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,6 +169,22 @@ endif() # ############################################################################## # Version number # ############################################################################## +if(UNIX AND NOT APPLE) + if(EXISTS "/etc/os-release") + # Read the contents of /etc/os-release + file(READ "/etc/os-release" OS_RELEASE_CONTENT) + + # Extract ID + string(REGEX MATCH "PRETTY_NAME=\"?([^\n\"]+)\"?" _ ${OS_RELEASE_CONTENT}) + set(RESINSIGHT_BUILD_SYSTEM_ID ${CMAKE_MATCH_1}) + + # Display the extracted values + message(STATUS "Operating System ID: ${RESINSIGHT_BUILD_SYSTEM_ID}") + else() + message(WARNING "/etc/os-release not found. Cannot determine OS details.") + endif() +endif() + include(ResInsightVersion.cmake) # ##############################################################################