diff --git a/cmake/BuildSteps/WriteVersionHeader.cmake b/cmake/BuildSteps/WriteVersionHeader.cmake index 8cf59b24bd..46b746c973 100644 --- a/cmake/BuildSteps/WriteVersionHeader.cmake +++ b/cmake/BuildSteps/WriteVersionHeader.cmake @@ -2,7 +2,7 @@ # This program source code file is part of KICAD, a free EDA CAD application. # # Copyright (C) 2015 Wayne Stambaugh -# Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors. +# Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -72,6 +72,7 @@ set( _wvh_new_version_text #endif #define KICAD_COMMIT_HASH \"${KICAD_COMMIT_HASH}\" +#define KICAD_VERSION \"${KICAD_VERSION}\" #define KICAD_VERSION_FULL \"${KICAD_VERSION_FULL}\" #define KICAD_SEMANTIC_VERSION \"${KICAD_SEMANTIC_VERSION}\" #define KICAD_MAJOR_VERSION \"${KICAD_MAJOR_VERSION}\" diff --git a/common/build_version.cpp b/common/build_version.cpp index a57f4bca87..3e32d1cf75 100644 --- a/common/build_version.cpp +++ b/common/build_version.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -71,6 +71,13 @@ wxString GetBuildVersion() } +wxString GetBaseVersion() +{ + wxString msg = wxString::Format( wxT( "%s" ), wxT( KICAD_VERSION ) ); + return msg; +} + + wxString GetBuildDate() { wxString msg = wxString::Format( wxT( "%s %s" ), wxT( __DATE__ ), wxT( __TIME__ ) ); diff --git a/common/drawing_sheet/ds_painter.cpp b/common/drawing_sheet/ds_painter.cpp index b89568921a..43c8d94130 100644 --- a/common/drawing_sheet/ds_painter.cpp +++ b/common/drawing_sheet/ds_painter.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors. * * * This program is free software; you can redistribute it and/or @@ -121,7 +121,7 @@ wxString DS_DRAW_ITEM_LIST::BuildFullText( const wxString& aTextbase ) if( token->IsSameAs( wxT( "KICAD_VERSION" ) ) && PgmOrNull() ) { - *token = wxString::Format( wxT( "%s %s" ), productName, GetSemanticVersion() ); + *token = wxString::Format( wxT( "%s %s" ), productName, GetBaseVersion() ); tokenUpdated = true; } else if( token->IsSameAs( wxT( "#" ) ) ) diff --git a/include/build_version.h b/include/build_version.h index 694e364770..5c92a7bda8 100644 --- a/include/build_version.h +++ b/include/build_version.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2007-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.TXT for contributors. + * Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.TXT for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -40,6 +40,14 @@ class wxString; */ KICOMMON_API wxString GetBuildVersion(); +/** + * Get the KiCad version string without the information added by the packagers. + * It is created by CMake in the KICAD_VERSION variable. + * + * @return the base version string + */ +KICOMMON_API wxString GetBaseVersion(); + /** * @return the bitness name string (like "Little endian") */