KiCad PCB EDA Suite
build_version.h File Reference

Go to the source code of this file.

Functions

wxString GetBuildVersion ()
 Get the full KiCad version string. More...
 
wxString GetPlatformGetBitnessName ()
 
wxString GetSemanticVersion ()
 Get the semantic version string for KiCad defined inside the KiCadVersion.cmake file in the variable KICAD_SEMANTIC_VERSION. More...
 
wxString GetMajorMinorVersion ()
 Get only the major and minor version in a string major.minor. More...
 
wxString GetBuildDate ()
 Get the build date as a string. More...
 
wxString GetVersionInfoData (const wxString &aTitle, bool aHtml=false, bool aBrief=false)
 Create a version info string for bug reports and the about dialog. More...
 

Function Documentation

◆ GetBuildDate()

wxString GetBuildDate ( )

Get the build date as a string.

Returns
the build date string

Definition at line 75 of file build_version.cpp.

76{
77 wxString msg = wxString::Format( wxT( "%s %s" ), wxT( __DATE__ ), wxT( __TIME__ ) );
78 return msg;
79}
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References Format().

Referenced by buildKicadAboutBanner(), GetVersionInfoData(), and KICAD_CURL_EASY::KICAD_CURL_EASY().

◆ GetBuildVersion()

wxString GetBuildVersion ( )

Get the full KiCad version string.

This string contains platform-specific information added by the packagers. It is created by CMake in the KICAD_FULL_VERSION variable.

Returns
the full version string

Definition at line 68 of file build_version.cpp.

69{
70 wxString msg = wxString::Format( wxT( "%s" ), wxT( KICAD_VERSION_FULL ) );
71 return msg;
72}

References Format().

Referenced by AddGerberX2Header(), GERBER_JOBFILE_WRITER::addJSONHeader(), DS_DRAW_ITEM_LIST::BuildFullText(), buildKicadAboutBanner(), CreateHeaderInfoData(), PCB_EDIT_FRAME::Export_IDF3(), PLACE_FILE_EXPORTER::GenPositionData(), PLACE_FILE_EXPORTER::GenReportData(), GetVersionInfoData(), KICAD_CURL_EASY::KICAD_CURL_EASY(), NETLIST_EXPORTER_XML::makeDesignHeader(), DSN::PARSER::PARSER(), GERBER_PLOTTER::StartPlot(), EXCELLON_WRITER::writeEXCELLONHeader(), PCB_CALCULATOR_DATAFILE::WriteHeader(), and NETLIST_EXPORTER_CADSTAR::WriteNetlist().

◆ GetMajorMinorVersion()

wxString GetMajorMinorVersion ( )

Get only the major and minor version in a string major.minor.

This is extracted by CMake from the KICAD_SEMANTIC_VERSION variable.

Returns
the major and minor version as a string

Definition at line 89 of file build_version.cpp.

90{
91 wxString msg = wxString::Format( wxT( "%s" ), wxT( KICAD_MAJOR_MINOR_VERSION ) );
92 return msg;
93}

References Format().

Referenced by EVT_MENU_RANGE(), GetKicadLockFilePath(), SETTINGS_MANAGER::GetSettingsVersion(), KICAD_MANAGER_FRAME::ProjectChanged(), and COMMON_CONTROL::ShowHelp().

◆ GetPlatformGetBitnessName()

wxString GetPlatformGetBitnessName ( )
Returns
the bitness name string (like "Little endian")

Definition at line 52 of file build_version.cpp.

53{
54 wxPlatformInfo platform;
55// TODO (ISM): Read conditional once our wx fork and flatpaks are running released 3.1.5
56// On Windows, use GetBitnessName if exists
57// I (J-PC) hope 3.1.6 has no problem
58#if defined( __WINDOWS__ ) && wxCHECK_VERSION( 3, 1, 5 )
59 return platform.GetBitnessName();
60#elif wxCHECK_VERSION( 3, 1, 6 )
61 return platform.GetBitnessName();
62#else
63 return platform.GetArchName();
64#endif
65}

Referenced by buildKicadAboutBanner(), GetVersionInfoData(), and KICAD_CURL_EASY::KICAD_CURL_EASY().

◆ GetSemanticVersion()

wxString GetSemanticVersion ( )

Get the semantic version string for KiCad defined inside the KiCadVersion.cmake file in the variable KICAD_SEMANTIC_VERSION.

Returns
the semantic version string

Definition at line 82 of file build_version.cpp.

83{
84 wxString msg = wxString::Format( wxT( "%s" ), wxT( KICAD_SEMANTIC_VERSION ) );
85 return msg;
86}

References Format().

◆ GetVersionInfoData()

wxString GetVersionInfoData ( const wxString &  aTitle,
bool  aHtml = false,
bool  aBrief = false 
)

Create a version info string for bug reports and the about dialog.

Parameters
aTitleis the application title to include at the top of the report
aBrief= true to condense information for the bug report URL
aHtml= true to use a minimal HTML format, false for plan text
Returns
the version info string

Definition at line 96 of file build_version.cpp.

97{
98 wxString aMsg;
99 // DO NOT translate information in the msg_version string
100
101 wxString eol = aHtml ? "<br>" : "\n";
102
103 // Tabs instead of spaces for the plaintext version for shorter string length
104 wxString indent4 = aHtml ? "&nbsp;&nbsp;&nbsp;&nbsp;" : "\t";
105
106#define ON "ON" << eol
107#define OFF "OFF" << eol
108
109 wxString version;
110 version << ( KIPLATFORM::APP::IsOperatingSystemUnsupported() ? "(UNSUPPORTED)"
111 : GetBuildVersion() )
112#ifdef DEBUG
113 << ", debug"
114#else
115 << ", release"
116#endif
117 << " build";
118
119 wxPlatformInfo platform;
120 aMsg << "Application: " << aTitle;
121
122 #if defined( KICAD_BUILD_ARCH_X64 )
123 aMsg << " (64-bit)";
124 #elif defined( KICAD_BUILD_ARCH_X86 )
125 aMsg << " (32-bit)";
126 #elif defined( KICAD_BUILD_ARCH_ARM )
127 aMsg << " (ARM 32-bit)";
128 #elif defined( KICAD_BUILD_ARCH_ARM64 )
129 aMsg << " (ARM 64-bit)";
130 #endif
131
132 aMsg << eol << eol;
133
134
135 aMsg << "Version: " << version << eol << eol;
136 aMsg << "Libraries:" << eol;
137
138 aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol;
139
140 aMsg << indent4 << "FreeType " << KIFONT::OUTLINE_FONT::FreeTypeVersion() << eol;
141 aMsg << indent4 << "HarfBuzz " << KIFONT::OUTLINE_FONT::HarfBuzzVersion() << eol;
142 aMsg << indent4 << "FontConfig " << KIFONT::OUTLINE_FONT::FontConfigVersion() << eol;
143
144 if( !aBrief )
145 aMsg << indent4 << GetKicadCurlVersion() << eol;
146
147 aMsg << eol;
148
149 aMsg << "Platform: " << wxGetOsDescription() << ", "
150 << GetPlatformGetBitnessName() << ", "
151 << platform.GetEndiannessName() << ", "
152 << platform.GetPortIdName();
153
154#ifdef __WXGTK__
155 aMsg << ", " << wxGetenv( "XDG_SESSION_DESKTOP" )
156 << ", " << wxGetenv( "XDG_SESSION_TYPE" );
157#endif
158
159 aMsg << eol << eol;
160
161 if( !aBrief )
162 {
163 aMsg << "Build Info:" << eol;
164 aMsg << indent4 << "Date: " << GetBuildDate() << eol;
165 }
166
167 aMsg << indent4 << "wxWidgets: " << wxVERSION_NUM_DOT_STRING << " (";
168 aMsg << __WX_BO_UNICODE __WX_BO_STL __WX_BO_WXWIN_COMPAT_2_8 ")";
169
170 // Get the GTK+ version where possible.
171#ifdef __WXGTK__
172 int major, minor;
173
174 major = wxPlatformInfo().Get().GetToolkitMajorVersion();
175 minor = wxPlatformInfo().Get().GetToolkitMinorVersion();
176 aMsg << " GTK+ " << major << "." << minor;
177#endif
178
179 aMsg << eol;
180
181 aMsg << indent4 << "Boost: " << ( BOOST_VERSION / 100000 ) << wxT( "." )
182 << ( BOOST_VERSION / 100 % 1000 ) << wxT( "." )
183 << ( BOOST_VERSION % 100 ) << eol;
184
185 aMsg << indent4 << "OCC: " << OCC_VERSION_COMPLETE << eol;
186 aMsg << indent4 << "Curl: " << GetCurlLibVersion() << eol;
187
188#if defined( KICAD_SPICE )
189#if defined( NGSPICE_BUILD_VERSION )
190 aMsg << indent4 << "ngspice: " << NGSPICE_BUILD_VERSION << eol;
191#elif defined( NGSPICE_HAVE_CONFIG_H )
192 #undef HAVE_STRNCASECMP /* is redefined in ngspice/config.h */
193 #include <ngspice/config.h>
194 aMsg << indent4 << "ngspice: " << PACKAGE_VERSION << eol;
195#elif defined( NGSPICE_PACKAGE_VERSION )
196 aMsg << indent4 << "ngspice: " << NGSPICE_PACKAGE_VERSION << eol;
197#else
198 aMsg << indent4 << "ngspice: " << "unknown" << eol;
199#endif
200#endif
201
202 aMsg << indent4 << "Compiler: ";
203#if defined(__clang__)
204 aMsg << "Clang " << __clang_major__ << "." << __clang_minor__ << "." << __clang_patchlevel__;
205#elif defined(__GNUG__)
206 aMsg << "GCC " << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__;
207#elif defined(_MSC_VER)
208 aMsg << "Visual C++ " << _MSC_VER;
209#elif defined(__INTEL_COMPILER)
210 aMsg << "Intel C++ " << __INTEL_COMPILER;
211#else
212 aMsg << "Other Compiler ";
213#endif
214
215#if defined(__GXX_ABI_VERSION)
216 aMsg << " with C++ ABI " << __GXX_ABI_VERSION << eol;
217#else
218 aMsg << " without C++ ABI" << eol;
219#endif
220
221 aMsg << eol;
222
223 // Add build settings config (build options):
224 aMsg << "Build settings:" << eol;
225
226#ifdef KICAD_USE_EGL
227 aMsg << indent4 << "KICAD_USE_EGL=" << ON;
228#endif
229
230 aMsg << indent4 << "KICAD_SPICE=";
231#ifdef KICAD_SPICE
232 aMsg << ON;
233#else
234 aMsg << OFF;
235#endif
236
237#ifndef NDEBUG
238 aMsg << indent4 << "KICAD_STDLIB_DEBUG=";
239#ifdef KICAD_STDLIB_DEBUG
240 aMsg << ON;
241#else
242 aMsg << OFF;
243 aMsg << indent4 << "KICAD_STDLIB_LIGHT_DEBUG=";
244#ifdef KICAD_STDLIB_LIGHT_DEBUG
245 aMsg << ON;
246#else
247 aMsg << OFF;
248#endif
249#endif
250
251 aMsg << indent4 << "KICAD_SANITIZE_ADDRESS=";
252#ifdef KICAD_SANITIZE_ADDRESS
253 aMsg << ON;
254#else
255 aMsg << OFF;
256#endif
257
258 aMsg << indent4 << "KICAD_SANITIZE_THREADS=";
259#ifdef KICAD_SANITIZE_THREADS
260 aMsg << ON;
261#else
262 aMsg << OFF;
263#endif
264#endif
265
266 return aMsg;
267}
#define OFF
std::string GetCurlLibVersion()
Definition: kicad_curl.cpp:142
std::string GetKicadCurlVersion()
Definition: kicad_curl.cpp:136
wxString GetBuildVersion()
Get the full KiCad version string.
wxString GetPlatformGetBitnessName()
#define ON
wxString GetBuildDate()
Get the build date as a string.
static wxString FreeTypeVersion()
static wxString FontConfigVersion()
static wxString HarfBuzzVersion()
bool IsOperatingSystemUnsupported()
Checks if the Operating System is explicitly unsupported and we want to prevent users from sending bu...
Definition: gtk/app.cpp:51
< Package version metadata Package metadata
Definition: pcm_data.h:74

References KIFONT::OUTLINE_FONT::FontConfigVersion(), KIFONT::OUTLINE_FONT::FreeTypeVersion(), GetBuildDate(), GetBuildVersion(), GetCurlLibVersion(), GetKicadCurlVersion(), GetPlatformGetBitnessName(), KIFONT::OUTLINE_FONT::HarfBuzzVersion(), KIPLATFORM::APP::IsOperatingSystemUnsupported(), OFF, and ON.

Referenced by DIALOG_ABOUT::createNotebooks(), DIALOG_ABOUT::onCopyVersionInfo(), and COMMON_CONTROL::ReportBug().