Kicad source compilation with MSVC

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.

2 Likes

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 : https://kicad.org/external-tools/

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.

2 Likes

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 ?

KiCad files are simple text files that can be manipulated by anything that can read and write files. Such tools typically require the affected KiCad files not to be loaded at this point in time. A good example for such standalone tools are library asset generator and test scripts like the ones used for the official library https://github.com/pointhi/kicad-footprint-generator, https://github.com/KiCad/kicad-library-utils. Or even things that manage the kicad config like the colour theme loader https://github.com/pointhi/kicad-color-schemes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.