OTB development on Windows
From OTBWiki
We had a wiki page OTB development on Windows With Eclipse to build older version of OTB with Eclipse, mxe, gcc, mingw. You could try same procedure with newer versions. Making same tutorial to work with last OTB release can be done but one has to jump through some hoops.
So.. if that scares you, then use otb with msvc2015. This is tested on a daily basis on Windows 7 & 8.1 VM.
All you have to have is MSVC2015, OTB xdk, and tools archive for windows.
Contents
Here is list of steps you can follow:
install msvc2015. Select custom installation and make sure you install c++ compiler
- Download tools archive: https://www.orfeo-toolbox.org//packages/xdk/Tools.zip
- unzip it to c:/Tools/. (beware of zip file extract the file to c:/Tools/Tools)
- Download 64bit xdk from here: https://www.orfeo-toolbox.org//packages/xdk/OTB-5.9/OTB-5.9.0-xdk-win64.zip
- unzip them to c:/dashboard/otb/xdk/OTB-5.9.0-xdk-win64 .
- beware of zip file extraction as above. Confirm that c:/dashboard/otb/xdk/OTB-5.9.0-xdk-win64/ directory has bin, lib, include etc.. rather than OTB-5.9.0-xdk-win64
Optional
- install clink for cmd.exe ( https://mridgers.github.io/clink/ )
- download and install python 2.7 to C:\Python27_x64 or C:\Python27_x86
Building OTB with MSVC
- open cmd.exe and run below code snippets
Setup environment
set TOOLS_DIR=C:\Tools set COMPILER_ARCH=x64 set SYSPATH=C:\Windows\system32;C:\Windows set PATH=%SYSPATH% set PATH=%PATH%;%TOOLS_DIR%\CMake-3.5.2\bin set PATH=%PATH%;%TOOLS_DIR%\patch-2.5.9-7\bin set PATH=%PATH%;%TOOLS_DIR%\wget-1.11.4-1\bin set PATH=%PATH%;%TOOLS_DIR%\Git-2.9.0\bin set PATH=%PATH%;%TOOLS_DIR%\ninja set PATH=%PATH%;%TOOLS_DIR%\jom\bin set PATH=%PATH%;%TOOLS_DIR%\7zip-16.02 set PATH=%PATH%;C:\Tools\swigwin-3.0.10 set PATH=%PATH%;C:\Python27_%COMPILER_ARCH%;C:\Python27_%COMPILER_ARCH%\Scripts call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %COMPILER_ARCH%
Configure & Build OTB
cd c:/dashboard/otb git clone --branch=develop https://git.orfeo-toolbox.org/git/otb.git src set CMAKE_PREFIX_PATH=c:/dashboard/otb/xdk/OTB-5.9.0-xdk-win64 set PATH=%PATH%;c:\dashboard\otb\xdk\OTB-5.9.0-xdk-win64\bin cmake ..\src -GNinja ninja