Windows (Visual Studio)

Building using Visual Studio (2019)

Environment Setup

Visual Studio

You must first install Visual Studio with the Desktop development with C++ feature set installed. Additionally, you’ll need to make sure the optional component C++ CMake tools for Windows is installed.

vcpkg (kicad fork required)

KiCad maintains a fork of vcpkg to provide us with a wxPython port. It also allows us to lock our dependencies as vcpkg updates fairly frequently.

If you are new to vcpkg you must, pick a spot on your system to put it. Then run these three commands

git clone https://gitlab.com/kicad/packaging/vcpkg
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg integrate install

which will give you a vcpkg install ready to use with the next steps

KiCad Specific Setup

vcpkg defaults to x86-windows even on 64-bit machines, it is advised for ease of use you set a USER or SYSTEM environment variable with the name VCPKG_DEFAULT_TRIPLET and value x64-windows

KiCad still supports 32-bit builds for now but may not in the future, thus 64-bit is preferred.

1. Install vcpkg packages

The following packages are required for vcpkg

.\vcpkg install boost
.\vcpkg install cairo
.\vcpkg install curl
.\vcpkg install glew
.\vcpkg install gettext
.\vcpkg install glm
.\vcpkg install icu
.\vcpkg install libxslt
.\vcpkg install ngspice
.\vcpkg install opencascade
.\vcpkg install opengl
.\vcpkg install openssl
.\vcpkg install python3
.\vcpkg install wxpython
.\vcpkg install wxwidgets
.\vcpkg install zlib

If you did not set the VCPKG_DEFAULT_TRIPLET environment variable, you will have to append :x64-windows to end of each packages name, boost:x64-windows for example.

If the vcpkg install fails on wxpython, you did not clone and checkout the kicad branch from https://gitlab.com/kicad/packaging/vcpkg for vcpkg

2. CMakeSettings.json

Contained in the build root is a CMakeSettings.json.sample, copy and rename this file to CMakeSettings.json Edit CMakeSettings.json update the VcPkgDir environment variable up top to match the location of your vcpkg clone.

{ "VcPkgDir": "D:/vcpkg/" },

3. "Open Folder" in Visual Studio

Launch Visual Studio (only after completing the above steps).

When the initial wizard launches, select to Open a local folder This is the correct way to make Visual Studio directly handle CMake projects.

Visual Studio Extensions

Trailing Whitespace Remover

It is highly recommended users install the Trailing Whitespace Visualizer which will not only highlight trailing whitespace as you type but also automatically remove it by default when you save the file.

Last Modified