Fix running from build dir on MacOS after recent build system changes

This commit is contained in:
Jon Evans 2021-04-28 23:21:19 -04:00
parent 91421f9908
commit f00cee438f
2 changed files with 21 additions and 0 deletions

View File

@ -143,8 +143,19 @@ const wxString KIWAY::dso_search_path( FACE_T aFaceId )
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
{
#ifdef __WXMAC__
// On Mac, all of the kifaces are placed in the kicad.app bundle, even though the individual
// standalone binaries are placed in separate bundles before the make install step runs.
// So, we have to jump up to the kicad directory, then the PlugIns section of the kicad
// bundle.
fn = wxStandardPaths::Get().GetExecutablePath();
fn.RemoveLastDir();
fn.RemoveLastDir();
fn.RemoveLastDir();
fn.RemoveLastDir();
fn.AppendDir( wxT( "kicad" ) );
fn.AppendDir( wxT( "kicad.app" ) );
fn.AppendDir( wxT( "Contents" ) );
fn.AppendDir( wxT( "PlugIns" ) );
fn.SetName( name );
#else

View File

@ -145,7 +145,17 @@ wxString PATHS::GetStockDataPath( bool aRespectRunFromBuildDir )
if( aRespectRunFromBuildDir && wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
{
// Allow debugging from build dir by placing relevant files/folders in the build root
#if defined( __WXMAC__ )
wxFileName fn = wxStandardPaths::Get().GetExecutablePath();
fn.RemoveLastDir();
fn.RemoveLastDir();
fn.RemoveLastDir();
fn.RemoveLastDir();
path = fn.GetPath();
#else
path = Pgm().GetExecutablePath() + wxT( ".." );
#endif
}
else
{