From BlenderWiki

Jump to: navigation, search


Building Blender with CMake

Configure Options

Using cmake-gui

cmake-gui is a graphical interface for configuring cmake and generating project files and make files, it does not actually build however.

Open cmake-gui and point to the source tree (C:\BlenderSVN\blender) and a destination directory for the temporarily object and executables files (example: C:\BlenderSVN\cmake-build). Select the target build system (Visual Studio 9 2008 for example). Hit the 'configure' button twice, optionally change some settings, and hit 'generate'. If you experience an error complaining about missing .dll's (such as libgmp-10.dll), then you will need to add C:\MinGW\bin (or C:\mingw64\bin) to your %PATH%.

After that you can build using the generated build files.

Command-line

For Windows 32-bit

cd C:\BlenderSVN
mkdir cmake-build
cd cmake-build
cmake ..\blender -G "Visual Studio 9 2008"

For 64-bit

cd C:\BlenderSVN
mkdir cmake-build
cd cmake-build
cmake ..\blender -G "Visual Studio 9 2008 Win64"

Prepare Visual Studio

For Visual Stdio 2008 Express users: No special preconditions are known. It should run out of the box.

For Visual Stdio 2008 PRO users: Please make sure that you have the "Visual studio 2008 Service pack 1" installed besides your Visual Studio 2008 Pro installation. You know that the service pack is missing when you get compile errors with functions from the c++ std:: library

Compile using Visual Studio

Just open the Visual Studio solution file and compile. Make sure to build the 'INSTALL' target before trying to run blender. The INSTALL target will copy the scripts and python files in the appropriate directory. The install target should be built after updating SVN otherwise blender may run with old scripts.

Note, since each build configuration has its own output path, you'll need to build the install target when switching configurations between Debug, Release for eg

Compile from the command line

If you have the full Visual Studio installed (not the free VC++ Express), you can also compile from the command line. In the following command just substitute [TARGET] with one of Debug, Release, RelMinSize, RelWithDebInfo.

 devenv Blender.sln /Build [TARGET] /Project INSTALL