I wanted to build FreeCAD on Windows to be able to do some local development. FreeCAD is already documented for this in the FreeCAD wiki. The steps are very clear, but I found some inconsistencies regarding paths and order of mentioned information. Maybe I have the option to change them in the wiki later. For now, I wanted a complete but very compact step-by-step file to go from “nothing” to “FreeCAD is built”.
I am writing this as the FreeCAD 1.1.0dev version is in development. The following steps were those I needed:
- Get the Visual Studio Installer and install the “Visual Studio Build Tools 2022” (version 17.12.4).
- Get Git for windows and install (version 2.48.1). It should be available on the system PATH.
- Get Cmake and install (version 3.31.4). It should be available on the system PATH.
- Download the matching LibPack release for FreeCAD and extract it somewhere (I put it at “C:/_public/GitHub/LibPack-1.1.0-v3.1.0-Release”).
- Clone the FreeCAD repository (I put it at “C:/_public/GitHub/FreeCAD”).
git clone --recurse-submodules https://github.com/FreeCAD/FreeCAD.git
- Open a terminal and do the basic cmake configuration via
cmake -S C:/_public/GitHub/FreeCAD -B C:/_public/GitHub/FreeCAD/build/release -G "Visual Studio 17 2022" -DFREECAD_LIBPACK_DIR:PATH="C:/_public/GitHub/LibPack-1.1.0-v3.1.0-Release" -DFREECAD_COPY_LIBPACK_BIN_TO_BUILD:BOOL="1" -DFREECAD_COPY_DEPEND_DIRS_TO_BUILD:BOOL="1" -DFREECAD_COPY_PLUGINS_BIN_TO_BUILD:BOOL="1"
- Build FreeCAD from command line via
cmake --build C:/_public/GitHub/FreeCAD/build/release --config Release
- After some time, the build finished and let me start FreeCAD.exe (In my case “C:/_public/GitHub/FreeCAD/build/release/bin/FreeCAD.exe”).