Buildenv is batch script used to set up build environments on Windows.
- Download and unzip the source .zip file into any location of your choice.
- Buildenv is used to setup a console window with pre-defined environmental setting.
- These setting are for the console session only, to avoid PATH pollution and avoids manually setting on each use.
- The setting are read from a .ini file created by the user in the ./ini folder.
- Running :file:`create-shortcut.bat` creates separate buildenv shortcuts on your desktop.
- There are two optional arguments [ini_location] [output_folder] - [ini_location] Reads any *.ini file, create corresponding buildenv shortcut : Default=".ini" - [output_folder] The directory where the shortcuts will be created : Default="<current_user>Desktop"
- Running the shortcut will call buildenv, passing the specific .ini setting, with a resulting console window.
- Add the relvant options, based on the following, to an .ini file placed in the ./ini folder
- The ini file has a number of flags
which can be set using the format
- start FOLDER, either relative to %HOMEDRIVE%%HOMEPATH% or absolute
- target BITS architecture: 32, or 64
- used to output all the environmental variables to a file used for CI building.
- the base FOLDER of your Python installation; its architecture must match BITS
- the base FOLDER of your SWIG installation
- the base FOLDER of your Blender installation;
- the base FOLDER of your msysGit installation;
- the base FOLDER of your NSIS installation;
- the base FOLDER of your CMake installation;
- the base FOLDER of your QMake installation;
- the base FOLDER of your 7-zip installation;
- the base FOLDER for the python debugger hook;
- COMPILER to set up: msvc2008, msvc2010, mingw, sdk60, sdk70, or sdk71; see below for detailed information
- the base FOLDER of your MSVC 2008 installation; implies compiler=msvc2008 when set
- the base FOLDER of your MSVC 2010 installation; implies compiler=msvc2010 when set
- the boost include FOLDER
- the boost library FOLDER; must match compiler and architecture
- the base FOLDER of your Qt SDK installation; use this flag when automatic detection fails
- Running :file:`buildenv.bat` without arguments will display the auto-detected values.
- Many of the values have defaults,
however you should set at least
- For Python development:
- You should also set
- For Python development, your choice of compiler
must match the compiler used to compile your version of Python.
For Python 2.6, 2.7, 3.0, 3.1, and 3.2, this is
msvc2008. For older versions of Python, you can try
mingw, although your mileage may vary.
archmust match the architecture of the Python at
- You should also set
- Other applications, such as Qt, msysGit, and NSIS, are automatically detected if installed at their default locations. Set the corresponding flags, if detection fails, or if detection picks the wrong version for you (for instance, if you have multiple versions of Qt installed, but you want :file:`buildenv.bat` to pick a particular one).
startflag is your working folder, either relative to
C:\Users\<username>, or absolute. If you use eclipse, you may want to type
The batch script does the following:
- Updates PATH for the specified version of Python.
- Updates PATH, INCLUDE, and LIB for the specified compiler.
- Updates Python's :file:`distutils.cfg` to use the specified compiler.
- Sets PYTHONFOLDER to the folder where the specified version of Python resides.
- Sets BLENDERHOME, BLENDERVERSION, BLENDERADDONS, and APPDATABLENDERADDONS according to whatever version of Blender is found via the registry.
- Sets QTHOME, QTVERSION, and QTDIR according to whatever version of the Qt SDK is found, and update PATH.
- Sets NSISHOME according to whatever version of NSIS is found, and update PATH.
- Sets GITHOME to the msysGit folder, and update PATH.
- Sets SEVENZIPHOME to the 7-zip folder, and updates PATH.
- Sets CMAKEHOME to the CMake folder, and update PATH.
- Sets SWIGHOME to the SWIG folder, and update PATH.
- Sets BOOST_INCLUDEDIR and BOOST_LIBRARYDIR according to their corresponding flags.
- mingw (32-bit only)
- Visual C++ 2008 Express (32-bit and 64-bit). For the 64-bit compiler, you also need the Windows SDK 7.0.
- Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1 (32-bit and 64-bit). This is SDK is also known as Windows SDK 7.0. The compilers are identical to the ones that come with Visual C++ 2008.
Visual C++ 2010 Express (32-bit only). You may also want to install Microsoft Visual Studio 2010 Service Pack 1. If you also plan on installing the Windows SDK 7.1, be sure to follow the recommended installation order, documented below.
The 64-bit target is not supported, essentially due to
vcvars64.batbeing missing even after installing Windows SDK 7.1. If you need to target 64-bit with a Visual C++ 2010 compatible compiler, use
Microsoft Windows SDK for Windows 7 and .NET Framework 4 (32-bit and 64-bit). This is SDK is also known as Windows SDK 7.1. The compilers are identical to the ones that come with Visual C++ 2010. You may also need Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1 in case you have Visual C++ 2010 SP1. Note the recommended installation order according to Microsoft:
- Visual Studio 2010
- Windows SDK 7.1
- Visual Studio 2010 SP1
- Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1
Supported versions of Blender
- 2.62, 2.63, 2.64, 2.65, 2.66, 2.67.
- Will detect the addon location, either local blender folder or users appdata folder.
Supported versions of Python
- Any. However, for compiling extension modules, only 2.6 and higher are well supported.
Supported versions of Qt SDK
- Only tested with Qt 4.7.4 with mingw (Qt SDK 1.1.4).
Supported versions of NSIS
Supported versions of Git
Supported versions of 7-Zip
Supported versions of CMake
- Auto-detects CMake 2.8 or user defined.
Supported versions of QMake
Supported versions of SWIG