Hugin SDK (MSVC 2013)

From PanoTools.org Wiki
Revision as of 18:31, 18 May 2015 by Thomas (talk | contribs) (Dependencies)
Jump to: navigation, search

This side contains some notes to compile Hugin with MS Visual Studio Community Edition 2013.

This instructions applies to build all libs as shared libraries (aka dll). In instructions refers to 32 and 64 bit except otherwise noted.

Prerequisites

First install the following prerequisites:

  • Visual Studio 2013 Community Edition: [1] (Please don't use the 2015 version. Not all needed libraries are updated for the new compiler generation.)
  • CMake [2] (select win32 installer )
  • Tortoise HG, to get code from repository [3] (select 32 or 64 bit, which one is appropriate for your system, not for the architecture you are building)
  • MS HTML Help Workshop, for creating the help file [4]
  • 7-zip, to extract some downloads [5]

Dependencies

General notes

  • First create a directory, where we build all libraries and program. This directory is called SDKROOT in the following steps. It's best to use a directory without white spaces or other special characters, e.g. c:\huginSDK would be a good point. Replace SDKROOT with your real path in all places.
  • There are mainly 2 build ways, depending on the library
    • The CMake way
    • The nmake way

In the following we will give only short instructions, and mention where differences to the general way are.

The CMake way

  1. Open the CMake (CMake-gui) from the start menu
  2. Browse to the path where you extracted the source
  3. Specify a path where the library is build. Normally use SDKROOT\build_lib (Replace lib with the name of the corresponding library.)
  4. Now select Configure, confirm directory creation, select Visual Studio 12 2013 for building 32 bit version or Visual Studio 12 2013 Win64 for the 64 bit version
  5. Tick option Advanced and Grouped to see all possible variables.
  6. When configure finished with error, edit some variables as described in the individual section. Then press configure again
  7. Repeat until CMake reports Configuring done and there are no red keys in the GUI.
  8. Now select Generate
  9. Open the generated project file (xxx.sln) in the build folder
  10. In Visual Studio check that on the top there is selected Release and 32 bit or x64.
  11. Select the project INSTALL, open context menu (right menu button) and select Build
  12. Now VS builds the lib and copies all necessary files to the install destination.

The nmake way

  1. Open Start>Visual Studio 2013>Visual Studio Tools
  2. Start VS2013 x86 Native Tools Command Prompt (for 32 bit) or VS2013 x64 Native Tools Command Prompt (for 64 bit)
  3. Switch to the path where you extracted the source
   cd SDKROOT\lib
  1. Now build the library. The exact instruction are given in the approbate section.

Boost

  • Download from [6] (.7z version is fine)
  • Extract to SDKROOT\boost_1_58_0
  • Now via the nmake way
    cd SDKROOT\boost_1_58_0
    bootstrap.bat
  • Now build for 32 bit with
    b2 --with-system --with-filesystem toolset=msvc variant=debug variant=release link=shared threading=multi runtime-link=shared stage

or for 64 bit (only 1 command)

    b2 --with-system --with-filesystem toolset=msvc variant=debug variant=release link=shared threading=multi runtime-link=shared address-model=64 stage

wxWidgets

  • Download from [7] Windows Source and extract source to SDKROOT\wxWidgets-3.0.2
  • Also via the nmake way
    cd SDKROOT\wxWidgets-3.0.2\build\msw
  • Now build for 32 bit
    nmake -f makefile.vc BUILD=debug SHARED=1 USE_OPENGL=1 RUNTIME_LIBS=dynamic
    nmake -f makefile.vc BUILD=release SHARED=1 USE_OPENGL=1 RUNTIME_LIBS=dynamic

or for 64 bit

    nmake -f makefile.vc BUILD=debug TARGET_CPU=AMD64 SHARED=1 USE_OPENGL=1 RUNTIME_LIBS=dynamic
    nmake -f makefile.vc BUILD=release TARGET_CPU=AMD64 SHARED=1 USE_OPENGL=1 RUNTIME_LIBS=dynamic

zlib

libpng

libtiff

libjpeg

IlmBase

OpenEXR

vigra

expat

exiv2

glut

glew

fftw3

lcms2

sqlite3

gettext

exiftool

  • Download exiftool [8] (select Windows Executable)
  • Create the directory SDKROOT\exiftool
  • Decompress the file to this folder and rename exiftool(-k).exe to exiftool.exe

panotools

Build Hugin