Browse Source

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

6.0.7
Jon Evans 5 years ago
parent
commit
f00cee438f
  1. 11
      common/kiway.cpp
  2. 10
      common/paths.cpp

11
common/kiway.cpp

@ -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

10
common/paths.cpp

@ -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
{

Loading…
Cancel
Save