| style="padding:5px; text-align:left" | The code pattern in <tt>exv_msvc.h</tt> must be deleted to disable auto-linking of zlib library, because the compression library wxzlib of wxWidgets is used here.

Revision as of 23:27, 8 May 2009

Hugin depends on different components like libraries and tools, which are not available on a common Windows system. All these components can be combined to a Hugin Software Developmant Kit (SDK). This article gives step-by-step instructions to build such SDK for Hugin using Microsoft Visual C++ 2008 (MSVC 2008) Express Edition and precompiled dependencies.

First of all an overview is given over the contents of the SDK and the tools that are necessary to build the SDK.

The build steps for each component are written like a walkthrough and annotated on the end of each section.

Maybe some of the described tools and packages, especially those fetched from Subversion (SVN) repository, will change over time and/or become obsolete. Hence it is likely that some steps will become invalid or won't work any more.

The SDK is structured, that each component resides in its own subdirectory. This approach is different to other platforms like Linux, where some common directories are available to store include files, libraries and applications. The files of a component are spread over all these directories. Both approaches to structure the files in a file system have its assets and drawbacks.

The base directory of the SDK is denoted as <SDKHOME> in this article. Replace <SDKHOME> by directory name where you store the SDK on your system. In the examples <SDKHOME> is replaced by the directory name D:\usr\src\SDK.

Contents

Prerequisites

To build the SDK some tools are required that are listed in the table below. Download the tools and install them. The destination directory of each tool is arbitrary. If you are uncertain, choose the default given in the setup dialog of each tool.

In the following subsections each component is discussed in detail. The order of the subsections seems random, but I applied the approach to describe the precompiled packages first, followed by the big packages, where some of the small packages depend on.

The decompress step of each component contains seemingly inconsistent namings of destination directories, because in some components a subdirectory is specified as destination directory and in some steps only the base directory. This is due to the fact that some package archives contain a base directory and some not. To check the right locations each result section of every component's description contains a summary of the expected files.

Enblend and Enfuse

Decompress the file enblend-enfuse-3.2.zip to directory <SDKHOME>

Result

The applications reside in
<SDKHOME>\enblend-enfuse-3.2

ExifTool

Create the directory <SDKHOME>\exiftool

Decompress the file exiftool-7.74.zip to <SDKHOME>\exiftool

Rename the file exiftool(-k).exe to exiftool.exe

Result

The application resides in
<SDKHOME>\exiftool

GetText

Create the directory <SDKHOME>\gettext

Decompress the following files to created directory <SDKHOME>\gettext

gettext-runtime-0.13.1.bin.woe32.zip

gettext-tools-0.13.1.bin.woe32.zip

libiconv-1.9.1.bin.woe32.zip

Result

The applications reside in
<SDKHOME>\gettext\bin

The include files reside in
<SDKHOME>\gettext\include

The libraries reside in
<SDKHOME>\gettext\lib

UnxUtils

Create the directory <SDKHOME>\UnxUtils

Decompress the file UnxUtils.zip to created directory <SDKHOME>\UnxUtils

Result

The applications reside in
<SDKHOME>\UnxUtils\bin and
<SDKHOME>\UnxUtils\usr\local\wbin

wxWidgets

Decompress the file wxMSW-2.8.10.zip to directory <SDKHOME>

Rename the directory <SDKHOME>\wxMSW-2.8.10 to <SDKHOME>\wxWidgets-2.8.10

After bjam.exe finished a statement like the following should be printed in the command prompt window

...updated 56 targets...
d:\usr\src\SDK\boost_1_39_0>

Close the Windows command prompt window

Result

The include files reside in
<SDKHOME>\boost_1_39_0 and its subdirectory boost

The libraries reside in
<SDKHOME>\boost_1_39_0\stage\lib

Notes

During build process temporary files are generated in <SDKHOME>\boost_1_39_0\bin.v2. This directory may be deleted to save disc space.

Hugin needs only the two Boost libraries date_time and thread, thus only these two libraries have to be built.
If you want to build all Boost libraries enter following command on the Windows command prompt instead of the command described above and press Return key.

bjam -–build-type=complete toolset=msvc stage

There are about 7GB disc space needed during build of all libraries (3.5GB for libraries and the same amount for the temporary files).

The Boost include files are typically included by a statement like#include "boost/whatever.hpp"
Therefore the base directory of the Boost include files is <SDKHOME>\boost_1_39_0

Only the following libraries are needed to build a release version of Hugin:

libboost_date_time-vc90-mt-s-1_39.lib

libboost_thread-vc90-mt-s-1_39.lib

The files with "gd" in the filename, e.g. libboost_thread-vc90-mt-sgd-1_39.lib, are the debug libraries.
The library files without "-1_39" suffix are automatically generated copies of the libraries with version suffix. They are used by CMake to detect the library directory.

OpenEXR

OpenEXR depends on following SDK component:

wxWidgets

Prepare this component before OpenEXR.

Create the directory <SDKHOME>\OpenEXR

Decompress the file ilmbase-1.0.1.tar.gz to created directory <SDKHOME>\OpenEXR

Decompress the file openexr-1.6.1.tar.gz to the same directory <SDKHOME>\OpenEXR
After decompress there should only exist the two directories ilmbase-1.0.1 and openexr-1.6.1 in <SDKHOME>\OpenEXR

Open solution file <SDKHOME>\OpenEXR\ilmbase-1.0.1\vc\vc8\IlmBase\IlmBase.sln
The Visual Studio Conversion Wizard dialog appears. Click Next, select option No, click Next and Finish. Unselect the option "Show the conversion log when the wizard is closed" and click Close

Due to the fact that the Visual Studio solutions of OpenEXR are configured to build dynamic libraries, some modifications are necessary to build the required static libraries:
For each project in Solution Explorer open the Property Pages dialog by choosing Project > Properties. Process the following steps for Debug and Release configuration. Some of the properties are not avaliable in every project, thus continue with next step.