Generate PYTHONPATH from CMake information
The CMake scripts calculate the install path for python scripts by distutils.sysconfig.get_python_lib( plat_specific=0, standard_lib=0, prefix='' ) which generates a string in line with lib/python2.7/site-packages This string ends up in the CMake variable PYTHON_DEST and is used by the install step as destination directory for pcbnew.py. There has been a hard-coded assumption on the content of that string in PcbNew which is not compatible with FreeBSD 11.1. This commit eliminates the hard-coded assumption in PcbNew and reuses the install path as known by CMake. Fixes: lp:1777921 * https://bugs.launchpad.net/kicad/+bug/1777921
This commit is contained in:
parent
0a9aedda8b
commit
dd3c24faf8
|
@ -72,4 +72,7 @@
|
||||||
#define KIFACE_SUFFIX "@KIFACE_SUFFIX@"
|
#define KIFACE_SUFFIX "@KIFACE_SUFFIX@"
|
||||||
#define KIFACE_PREFIX "@KIFACE_PREFIX@"
|
#define KIFACE_PREFIX "@KIFACE_PREFIX@"
|
||||||
|
|
||||||
|
/// Allows scripts install directory to be referenced by the program code.
|
||||||
|
#define PYTHON_DEST "@PYTHON_DEST@"
|
||||||
|
|
||||||
#endif // CONFIG_H_
|
#endif // CONFIG_H_
|
||||||
|
|
|
@ -263,10 +263,10 @@ static bool scriptingSetup()
|
||||||
wxSetEnv( "PYTHONPATH", pypath );
|
wxSetEnv( "PYTHONPATH", pypath );
|
||||||
|
|
||||||
#else
|
#else
|
||||||
// Linux-specific setup
|
|
||||||
wxString pypath;
|
wxString pypath;
|
||||||
|
|
||||||
pypath = Pgm().GetExecutablePath() + wxT( "../lib/python2.7/dist-packages" );
|
// PYTHON_DEST is the scripts install dir as determined by the build system.
|
||||||
|
pypath = Pgm().GetExecutablePath() + wxT( "../" PYTHON_DEST );
|
||||||
|
|
||||||
if( !wxIsEmpty( wxGetenv( wxT( "PYTHONPATH" ) ) ) )
|
if( !wxIsEmpty( wxGetenv( wxT( "PYTHONPATH" ) ) ) )
|
||||||
pypath = wxString( wxGetenv( wxT( "PYTHONPATH" ) ) ) + wxT( ":" ) + pypath;
|
pypath = wxString( wxGetenv( wxT( "PYTHONPATH" ) ) ) + wxT( ":" ) + pypath;
|
||||||
|
|
Loading…
Reference in New Issue