Using CMake on Windows with special requirements

This page provides instructions for building STIR with CMake on Windows in special corner cases. Most people will not need this and just want to refer to the normal build instructions at Installing_STIR_with_CMake.

If you need to let CMake find executables or dlls in a particular location, you can either "c:\Program Files (x86)\CMake 2.8\bin\cmake-gui" Below are some examples where this strategy would be necessary.
 * add its location to your system path (via the System control panel, click on Advanced Settings, select Environment Variables),
 * or modify the CMake-gui shortcut to set this location as the CMake startup,
 * or open a command prompt, cd to the directory (or add it to the path) and launch CMake from there, possibly via something like

Using the Windows SDK even if you have Visual Studio installed
You might want the use the compilers from the Windows SDK, for instance for compatibility with some external library.

If you didn't add the SDK to the system path, CMake will not find it. One solution for this is as follows:


 * launch CMake from an SDK command prompt (there is probably an SDK folder in your Start menu with an appropriate entry)


 * When pressing "Configure", you will have to use a "generator" that is compatible with the SDK. "nmake" should work. For SDK 7.1, you could use "Visual Studio 10" and then build via "msbuild" (see main page).

Using SWIG compiled with Cygwin while using Visual Studio for compilation of STIR
STIR can use SWIG to generate an interface to Python (or soon MATLAB). You can download SWIG executables for Windows from its website. However, in case you want to use a brand-new version of SWIG, you will need to build it yourself. At present (end 2014), SWIG can only be build on Linux-type systems. You could try to use MSYS (after downloading a number of packages), but it is easier with Cygwin (after installing autoconf, bison etc). However, now you need to point CMake to the swig executable, which will only run if CMake will find your cygwin1.dll. In addition, when building STIR, Visual Studio will need to run swig, so the recommended method is to add the location of the cygwin dll (which could be c:\cygwin64\bin) to your system path before starting CMake.