Kicad source compilation with MSVC

anyone already tested MSVC kicad source compilation ?


There have been discussion about it and some work towards it, but you should probably ask in the developers mailing list.

Yes, we do automated builds with Jenkins for each commit and weekly runs with /ANALYZE.

It’s a bit difficult because one has to compile all the dependencies first, vcpkg doesn’t have a complete set yet, and Python support is currently missing in the MSVC builds.

1 Like

could you give me a little support to make my first own compilation on my own system ? i would like to know rights steps and what i need to pay attention to make a clean job.

I’m attaching my CMakeSettings.json from VS2019. You’ll want to install vcpkg if you haven’t already.

CMakeSettings.json (4.0 KB)

First, install the dependencies using something like:
./vcpkg.exe install glew glm boost wxwidgets curl cairo

Then modify my CMakeSettings.json to point to the appropriate path to where you installed vcpkg for the cmakeToolchain variables.

This should get you to something that builds in VS2019. As Simon mentioned, OCE, ngspice, and Python are currently not supported and I haven’t spent any time figuring out how to add support for them. This means the KiCad you build will be missing features, but depending on what you are developing this might not matter.


You should consider unless you like navigating to your user profile directory all day.

  "buildRoot": "${projectDir}\\out\\build\\${name}",

That appears to be the auto-generated default. I never navigate to that directory; I just hit “run” or “debug” inside VS and it does the right thing.

how many time take a kicad compilation ?

It depends heavily on your hardware. Prepare for at least half a day or overnight if it’s not the latest and greatest. I haven’t tried MSVC, though - it may take even longer if much of the dependencies must be compiled.

recompiling after files modification could significantly decrease compiling time ? (and son make coding and testing possible ?)

Yes. Only compiling from scratch takes long, long time.

using MSYS2 will provide a support for OCE, NGspice and python ?
where can i find the doc about third party application developpement ?

The “official” KiCad package for Windows is compiled with msys, so you will get all the features.

and for the doc about third party dev ? i found nothing on the general kicad doc

Can you say more about what you mean by third-party application development?

it’s that :

There is no specific guideline on making tools to work with KiCad. Depending on what specifically you are trying to do, we might be able to give advice on an approach, though!

there is no concret project. i just looked for the doc about developing external tool. are they script coded in python directly inside kicad ? or are they interfaced executable like DLL ?

There is no one answer to that question.
Some of them are Python scripts that are executed inside KiCad (see Tutorials on python scripting in pcbnew for some information about this)
Some of them are standalone programs (written in whatever language the author chose) that just interact with KiCad files.
KiCad does not have a mechanism for loading third-party code (DLLs, for example), the only plugin functionality supported is via Python.


ok thanks i’ll see that, but ont the other hand how standalone programs are they interfaced if kicad don’t provide a third party loading mechainsm ?