Use a version string without the extra packaging info in drawing sheets.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17176
This commit is contained in:
Alex Shvartzkop 2024-02-29 04:24:12 +03:00
parent 0dab086f0c
commit c59fac4089
4 changed files with 21 additions and 5 deletions

View File

@ -2,7 +2,7 @@
# This program source code file is part of KICAD, a free EDA CAD application. # This program source code file is part of KICAD, a free EDA CAD application.
# #
# Copyright (C) 2015 Wayne Stambaugh <stambaughw@gmail.com> # Copyright (C) 2015 Wayne Stambaugh <stambaughw@gmail.com>
# 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 # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
@ -72,6 +72,7 @@ set( _wvh_new_version_text
#endif #endif
#define KICAD_COMMIT_HASH \"${KICAD_COMMIT_HASH}\" #define KICAD_COMMIT_HASH \"${KICAD_COMMIT_HASH}\"
#define KICAD_VERSION \"${KICAD_VERSION}\"
#define KICAD_VERSION_FULL \"${KICAD_VERSION_FULL}\" #define KICAD_VERSION_FULL \"${KICAD_VERSION_FULL}\"
#define KICAD_SEMANTIC_VERSION \"${KICAD_SEMANTIC_VERSION}\" #define KICAD_SEMANTIC_VERSION \"${KICAD_SEMANTIC_VERSION}\"
#define KICAD_MAJOR_VERSION \"${KICAD_MAJOR_VERSION}\" #define KICAD_MAJOR_VERSION \"${KICAD_MAJOR_VERSION}\"

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * 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 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 * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * 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 GetBuildDate()
{ {
wxString msg = wxString::Format( wxT( "%s %s" ), wxT( __DATE__ ), wxT( __TIME__ ) ); wxString msg = wxString::Format( wxT( "%s %s" ), wxT( __DATE__ ), wxT( __TIME__ ) );

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * 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 * 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() ) 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; tokenUpdated = true;
} }
else if( token->IsSameAs( wxT( "#" ) ) ) else if( token->IsSameAs( wxT( "#" ) ) )

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * 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) 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 * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -40,6 +40,14 @@ class wxString;
*/ */
KICOMMON_API wxString GetBuildVersion(); 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") * @return the bitness name string (like "Little endian")
*/ */