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 -b develop https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb.git 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