mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-20 15:51:41 +00:00
Set PYTHONPATH internally for macOS run from build dir
This commit is contained in:
parent
53a90ccb88
commit
e5f1cfd2b2
@ -91,6 +91,8 @@
|
||||
/// Allows scripts install directory to be referenced by the program code.
|
||||
#define PYTHON_DEST "@PYTHON_DEST@"
|
||||
|
||||
#define PYTHON_SITE_PACKAGE_PATH "@PYTHON_SITE_PACKAGE_PATH@"
|
||||
|
||||
/// Allows scripts install directory to be referenced by the program code.
|
||||
#define KICAD_DATA "@KICAD_DATA@"
|
||||
|
||||
|
@ -281,6 +281,13 @@ bool SCRIPTING::scriptingSetup()
|
||||
pypath = wxString( wxGetenv( wxT( "PYTHONPATH" ) ) ) + wxT( ":" ) + pypath;
|
||||
}
|
||||
|
||||
// Hack for run from build dir option
|
||||
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
|
||||
{
|
||||
pypath = wxString( wxT( PYTHON_SITE_PACKAGE_PATH ) ) + wxT( "/../:" )
|
||||
+ wxT( PYTHON_SITE_PACKAGE_PATH ) + wxT( ":" ) + wxT( PYTHON_DEST );
|
||||
}
|
||||
|
||||
// set $PYTHONPATH
|
||||
wxSetEnv( wxT( "PYTHONPATH" ), pypath );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user