Skip to content

Instantly share code, notes, and snippets.

@johnbeard
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnbeard/4d1a8e43b05bcb03e9b4 to your computer and use it in GitHub Desktop.
Save johnbeard/4d1a8e43b05bcb03e9b4 to your computer and use it in GitHub Desktop.
Building Kicad
# Normal cmake config
localKicad=~/local/kicad
localKicadPython=$localKicad/usr/lib/python2.7/dist-packages/
alias cmake.kicad="cmake -DMAINTAIN_PNGS=ON -DCMAKE_BUILD_TYPE=Debug -DKICAD_SCRIPTING=ON -DKICAD_SCRIPTING_MODULES=ON -DKICAD_SCRIPTING_WXPYTHON=ON -DPYTHON_DEST=$localKicadPython -DCMAKE_INSTALL_PREFIX=~/local/kicad -DCMAKE_VERBOSE_MAKEFILE=OFF -DCMAKE_CXX_COMPILER=/usr/bin/ccache -DCMAKE_CXX_COMPILER_ARG1=g++ $1"
# Environment variables for a local kicad installation
export PYTHONPATH=$PYTHONPATH:$localKicadPython
export PATH=$PATH:$localKicad/bin

To build KiCad on Linux:

  1. Install the following extra packages (Ubuntu):

    • libgl1-mesa-dev libglew-dev libcairo2-dev libbz2-dev libssl-dev libwebkitgtk-dev libpython-dev swig2.0 pngcrush doxygen

  2. Install wxPython 3 from Adam Wolf’s PPA (Ubuntu only)

    • sudo add-apt-repository ppa:adamwolf/kicad-trusty-backports

    • sudo apt-get update

    • sudo apt-get install libwxgtk3.0-dev python-wxgtk3.0-dev

  3. Source .bashrc.kicad

  4. Create a build dir, cd to it

    • mkdir /path/to/builddir/

    • cd /path/to/builddir/

  5. Run cmake.kicad with the KiCad source dir as the argument:

    • cmake.kicad /path/to/source

  6. Run something like nice -n19 make -j6 all to build. Change all to pcbnew and so on if that’s all you need.

    • make install to install - you need to do this to get the Python modules on the PYTHONPATH

  7. Run from e.g. ./pcbnew/pcbnew (or eeschema, etc), or the installed location (useful as a working backup while you hack away). You only need to install again if you change something SWIG’y.

Notes

  • cmake 2.8.9 (Debian Wheezy version) has a bug and results in FOUND_VAR (missing: REQUIRED_VARS VERSION_VAR) (Required is at least version "3.0.0"), regardless of the available wxWidgets version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment