Allow launching standalone procs from build dir

This commit is contained in:
Jon Evans 2024-02-06 21:33:11 -05:00
parent 874be359e0
commit 181100fe44
1 changed files with 11 additions and 1 deletions

View File

@ -64,6 +64,16 @@ wxString FindKicadFile( const wxString& shortname )
if( wxFileExists( fullFileName ) )
return fullFileName;
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
{
wxFileName buildDir( Pgm().GetExecutablePath(), shortname );
buildDir.RemoveLastDir();
buildDir.AppendDir( shortname );
if( wxFileExists( buildDir.GetFullPath() ) )
return buildDir.GetFullPath();
}
// Test the presence of the file in the directory shortname
// defined by the environment variable KiCad.
if( Pgm().IsKicadEnvVariableDefined() )
@ -340,4 +350,4 @@ bool RmDirRecursive( const wxString& aFileName, wxString* aErrors )
}
return true;
}
}