diff --git a/common/kiway.cpp b/common/kiway.cpp index 8f2d6037e9..6b7e12b2c5 100644 --- a/common/kiway.cpp +++ b/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 diff --git a/common/paths.cpp b/common/paths.cpp index 0c8bd780b9..69e4ec4611 100644 --- a/common/paths.cpp +++ b/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 {