The following procedure will work for compiling on Windows Vista/7/8, for XP an alternate VS tool set is required for VS 2012 and 2013, which has not been tested successfully with the current Libpacks. To target XP(both x32 and x64) it is recommended to use VS2008 and Libpack FreeCADLibs_11.0_x86_VC9.7z
FreeCAD is built upon a number of third party libraries. For the users convenience FreeCAD supplies Libpacks that contain all the necessary dependencies so you don't have to compile them yourself.
First you'll need to download a Windows Libpack. FreeCAD Windows Libpacks are available here: http://sourceforge.net/projects/free-cad/files/FreeCAD%20LibPack/
Libpacks are available for x32 and x64 for VC12(Visual Studio 2013), VC11(Visual Studio 2012), and VC9(Visual Studio 2008) The Libpacks will work with both the Professional and Express/Community Editions of Visual Studio. Choose the Libpack relevant to your system architecture and Compiler.
Assuming that your Win Vista or later, x64, and planning to use VS2013 Community Edition choose:
Extract the Libpack to a directory on your hard drive.
You can download 7-zip if you need it here: http://www.7-zip.org/
Next you will need to install git to be able to download the source code. You can get Git here: http://git-scm.com/downloads
Some information how to set-up a local tracking branch and a working branch can be found here:
To create a local tracking branch and download the source code you need to open a terminal(command prompt) and cd to the directory you want the source, then type:
git clone git://git.code.sf.net/p/free-cad/code free-cad-code
Now you have the source code and the tools you'll need to compile FreeCAD on Windows.
You will need to extract this to a directory using 7zip or Window's default .zip extractor.
NOTE: In order for Cmake to properly update your "About FreeCAD" information git must be installed and be present in your PATH environment variable, Therefore downloading with git is preferred.
Next you will need Cmake, you can get it here: http://www.cmake.org/download/
FreeCAD 0.15.xxxx master will configure and generate with Cmake 2.x.x or 3.x.x, you can download the latest version. Older versions of FreeCAD require Cmake 2.x.x You should choose the non-default option to add Cmake to your system PATH environment variable.
Lastly you will need the C-compiler. MS VS 12 2013 Community Edition Update 4 is Free for personal and Open Source Projects. It can be downloaded here:
Start the CMake GUI by double-clicking on the desktop icon created during installation.
Specify source folder (This is where you cloned or extracted the source code)
Specify build folder (This is where you want to build the source, if it doesn't exist Cmake will prompt you to create it)
Specify the generator as Visual Studio 12 x64(or the alternate C-Compiler you are using)
This will begin configuration and should fail because the location of FREECAD_LIBPACK_DIR is unset.
Expand the FREECAD category and set:
FREECAD_LIBPACK_DIR "...\Path\to\Libpack" (Ex: C:\user\USERNAME\FreeCADLibs_11.0_x64_VC12) FREECAD_USE_EXTERNAL_PIVY (Check) FREECAD_USE_FREETYPE (Check)
FREETYPE is optional. It is necessary to take advantage of the DRAFT Work Bench's Shape String functionality. Under normal situations it is a desirable option.
Click Configure again (There should be no errors)
Click Generate (missing doxgen is OK, unless you are a developer and need the source documentation)
Copy The Libpack\bin folder into the new build folder CMake created.
You could put the Libpack in your system PATH environment variable. but you still are required to copy some files?
Start Visual Studio 12 2013 by clicking on the desktop icon created at installation.
Open the project by: File -> Open -> Project/Solution
Open FreeCAD_Trunk.sln from the build folder CMake created
Switch the Solutions Configuration drop down at the top to Release X64
Build -> Build Solution
This will take a long time...
If you don't get any errors your done. Exit Visual Studio and start FreeCAD by double clicking the FreeCAD icon in the bin folder of the build directory.