Change the platform detection order
Make sure that windows-specific getWindowsKiCadRoot() is only called on Windows
This commit is contained in:
parent
d904535a15
commit
01cb1543bb
|
@ -295,12 +295,16 @@ wxString PATHS::GetStockPlugins3DPath()
|
||||||
{
|
{
|
||||||
wxFileName fn;
|
wxFileName fn;
|
||||||
|
|
||||||
#ifdef __WXGTK__
|
#if defined( __WXMSW__ )
|
||||||
// KICAD_PLUGINDIR = CMAKE_INSTALL_FULL_LIBDIR path is the absolute path
|
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
|
||||||
// corresponding to the install path used for constructing KICAD_USER_PLUGIN
|
{
|
||||||
wxString tfname = wxString::FromUTF8Unchecked( KICAD_PLUGINDIR );
|
fn.AssignDir( getWindowsKiCadRoot() );
|
||||||
fn.Assign( tfname, "" );
|
}
|
||||||
fn.AppendDir( wxT( "kicad" ) );
|
else
|
||||||
|
{
|
||||||
|
fn.AssignDir( GetExecutablePath() );
|
||||||
|
}
|
||||||
|
|
||||||
fn.AppendDir( wxT( "plugins" ) );
|
fn.AppendDir( wxT( "plugins" ) );
|
||||||
#elif defined( __WXMAC__ )
|
#elif defined( __WXMAC__ )
|
||||||
fn.Assign( wxStandardPaths::Get().GetPluginsDir(), wxEmptyString );
|
fn.Assign( wxStandardPaths::Get().GetPluginsDir(), wxEmptyString );
|
||||||
|
@ -323,15 +327,11 @@ wxString PATHS::GetStockPlugins3DPath()
|
||||||
fn.AppendDir( wxT( "PlugIns" ) );
|
fn.AppendDir( wxT( "PlugIns" ) );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
|
// KICAD_PLUGINDIR = CMAKE_INSTALL_FULL_LIBDIR path is the absolute path
|
||||||
{
|
// corresponding to the install path used for constructing KICAD_USER_PLUGIN
|
||||||
fn.AssignDir( getWindowsKiCadRoot() );
|
wxString tfname = wxString::FromUTF8Unchecked( KICAD_PLUGINDIR );
|
||||||
}
|
fn.Assign( tfname, "" );
|
||||||
else
|
fn.AppendDir( wxT( "kicad" ) );
|
||||||
{
|
|
||||||
fn.AssignDir( GetExecutablePath() );
|
|
||||||
}
|
|
||||||
|
|
||||||
fn.AppendDir( wxT( "plugins" ) );
|
fn.AppendDir( wxT( "plugins" ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue