Update pleditor path for run from build directory

This commit is contained in:
Ian McInerney 2019-10-03 19:27:23 +02:00 committed by Wayne Stambaugh
parent d837a212aa
commit 3a2dbf7786
1 changed files with 10 additions and 3 deletions

View File

@ -95,6 +95,7 @@ void KIWAY::SetTop( wxFrame* aTop )
const wxString KIWAY::dso_search_path( FACE_T aFaceId ) const wxString KIWAY::dso_search_path( FACE_T aFaceId )
{ {
const char* name; const char* name;
const char* dirName;
switch( aFaceId ) switch( aFaceId )
{ {
@ -111,6 +112,13 @@ const wxString KIWAY::dso_search_path( FACE_T aFaceId )
return wxEmptyString; return wxEmptyString;
} }
// The subdirectories usually have the same name as the kiface
switch( aFaceId )
{
case FACE_PL_EDITOR: dirName = "pagelayout_editor"; break;
default: dirName = name + 1; break;
}
#ifndef __WXMAC__ #ifndef __WXMAC__
wxString path; wxString path;
@ -135,8 +143,7 @@ const wxString KIWAY::dso_search_path( FACE_T aFaceId )
#ifdef DEBUG #ifdef DEBUG
// To speed up development, it's sometimes nice to run kicad from inside // To speed up development, it's sometimes nice to run kicad from inside
// the build path. In that case, each program will be in a subdirectory. // the build path. In that case, each program will be in a subdirectory.
// To find the DSOs, we need to go up one directory and then enter a subdirectory // To find the DSOs, we need to go up one directory and then enter a subdirectory.
// with the same name as the DSO (without the prefix).
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) ) if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
{ {
@ -147,7 +154,7 @@ const wxString KIWAY::dso_search_path( FACE_T aFaceId )
fn.SetName( name ); fn.SetName( name );
#else #else
fn.RemoveLastDir(); fn.RemoveLastDir();
fn.AppendDir( name + 1 ); fn.AppendDir( dirName );
#endif #endif
} }
#endif #endif