Building Voreen 5.0 on Windows

Windows Logo

 

 

We strongly suggest to use Microsoft Visual Studio 2017, 2019 or 2022 for building Voreen on Windows. Though compiling with MinGW / Qt-Creator should work in theory, we do not actively support this build environment or even test our releases on it.

In the following, we describe how to build Voreen with Visual Studio.

0. Preparations

  • Obtain the Voreen source distribution.
  • NOTE: Due to a path length limitation, MSVC and Qt won't compile if relative paths exceed a certain length. Therefore, we strongly recommend to put the source directory either directly in the root folder of your system drive or anywhere on another drive which forces absolute path conversion.
  • Install the CMake build system.
  • Install the Qt library:
    NOTE: Any Qt version newer than 5.5 is supported.
    • Obtain the Qt SDK from http://qt-project.org/downloads and install it.
    • If you want to build Voreen using Visual Studio 2013, 2015 or 2017, you are already done here, since the Qt SDK contains suitable 64-bit binaries for the respective compilers.
    • For Visual Studio 2012 builds, however, you have to download the last supported version which is Qt 5.5.1 and compile it yourself in 64-bit.
      • Download any of the provided archives and extract it to any location
      • Open the VS2012 x64 Cross Tools-Command Prompt and change to that location
      • Configure the build (For details, refer to Qt's documentation):

        configure -platform win32-msvc2012 -no-sql-sqlite -no-dbus -debug-and-release -opengl desktop -mp
      • Qt 5.5.1 has a known bug when compiling with Visual Studio 2012. You need to install Python 2.7 before and add it to the PATH environment varialbe (possible using pythons windows setup file).
      • Build the libraries:

        nmake install
      • The libraries should now be located in the QtBase/lib/ subdirectory. The qmake.exe should reside in QtBase/bin/.

1. Configure Voreen Build using CMake

  • Start the CMake GUI tool.
  • Set the CMake source directory to the Voreen base directory (where the CMakeLists.txt is located)
  • Select an arbitrary build directory. We support both in-source builds (build directory equals source directory) as well as out-of-source builds (build directory differs from source directory). Out-of-source builds are usually preferred, since they prevent the source tree from being polluted with build residues.
  • Hit the Configure button and select the appropriate CMake generator for your Visual Studio version.
    Note:  You have to select the Win64 variant here.
  • After the initial configuration run, you will probably be confronted with the following error message telling you that the Qt5 library has not been found, unless you added Qt to your environment variables. This error can be fixed by setting the Qt5_DIR-NOTFOUND option to the lib/cmake/Qt5 folder in the Qt SDK.

    Cmake Err
























     

 

 

 

  • After having run Configure again, the CMake dialog should look a lot friendlier:

    Cmake Ok
























     

 

 

 

  • Adapt the Voreen build to your needs by enabling the applications and libraries that should be built and selecting the modules you want to include (see CMake options). For the first build, we suggest to stick with the default configuration.
  • Hit the Generate button, in order to generate a Visual Studio Solution file called Voreen.sln in the build directory.

 

2. Build Project in Visual Studio

  • Open the generated Voreen.sln file in Visual Studio. The Solution contains a separate project for each Voreen library and application that has been enabled in the CMake configuration. Project dependencies are properly set.
  • Build the Solution.
  • Set voreenve as start-up project and have fun :)