← Back to team overview

kicad-developers team mailing list archive

Re: Python scripting cmake build macros.

 

Le 16/01/2013 18:56, Wayne Stambaugh a écrit :
On 1/16/2013 12:16 PM, Miguel Angel Ajo Pelayo wrote:
Other option we could have right now is compile out the wxpython support and provide
only embedded python scripting + python pcbnew module for windows users.

In that case, next functionalities are lost:

1) PyCrust shell inside pcbnew
2) Ability to create and run own wx-uis in the embedded python scripting.

And we keep:

3) pcbnew module for commandline python scripting
4) embedded pcbnew wizards & plugins

There are 2 levels of complexity, to build a scripting version of Kicad (for Windows). level 1 - python scripting + python pcbnew module for windows users, which is not so hard to build
level 2 - use wxpython support, which is (by far) tricky.

For level 1, requirements to compil Kicad are not so hard:
a) download and install python 2.7 (obvioulsy)
b) download and install swig (easy)

define the 5 paths:
PYTHON_EXECUTABLE (could needed also on Linux)
SWIG_DIR
SWIG_EXECUTABLE
PYTHON_INCLUDE_DIR
PYTHON_LIBRARY

Here is the script I am using under Windows to run cmake:

WXMSW=/d/wxWidgets-2.9.4/Release
echo wxWidgets path = $WXMSW
export PATH=$PATH:$WXMSW:/d/inkscape:/d/pngcrush
VERSION=-DKICAD_TESTING_VERSION=0N
TOOL0=-DPYTHON_EXECUTABLE="/d/python27/python.exe"
TOOL1=-DSWIG_DIR="/e/swigwin-2.0.7"
TOOL2=-DSWIG_EXECUTABLE="/e/swigwin-2.0.7/swig.exe"
TOOL3=-DPYTHON_INCLUDE_DIR="/d/Python27/include"
TOOL4=-DPYTHON_LIBRARY="/d/Python27/libs/libpython27.a"
OPT1=-DKICAD_SCRIPTING=ON
OPT2=-DKICAD_SCRIPTING_MODULES=ON
OPT3=-DKICAD_SCRIPTING_WXPYTHON=OFF
OPT4=-DUSE_PCBNEW_NANOMETRES=ON
OPT5=-DMAINTAIN_PNGS=OFF
INST_DIR=-DCMAKE_INSTALL_PREFIX=g:/kicad
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release\
    $TOOL1 $TOOL0 $TOOL2 $TOOL3 $TOOL4\
    $OPT1 $OPT2 $OPT3 $OPT4 $OPT5\
    $VERSION $INST_DIR -DwxWidgets_ROOT_DIR=$WXMSW ../../

--
Jean-Pierre CHARRAS



References