Fix running from build dir on MacOS after recent build system changes
This commit is contained in:
parent
91421f9908
commit
f00cee438f
|
@ -143,8 +143,19 @@ const wxString KIWAY::dso_search_path( FACE_T aFaceId )
|
||||||
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
|
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
|
||||||
{
|
{
|
||||||
#ifdef __WXMAC__
|
#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 = wxStandardPaths::Get().GetExecutablePath();
|
||||||
|
|
||||||
fn.RemoveLastDir();
|
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.AppendDir( wxT( "PlugIns" ) );
|
||||||
fn.SetName( name );
|
fn.SetName( name );
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -145,7 +145,17 @@ wxString PATHS::GetStockDataPath( bool aRespectRunFromBuildDir )
|
||||||
if( aRespectRunFromBuildDir && wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
|
if( aRespectRunFromBuildDir && wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
|
||||||
{
|
{
|
||||||
// Allow debugging from build dir by placing relevant files/folders in the build root
|
// 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( ".." );
|
path = Pgm().GetExecutablePath() + wxT( ".." );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue