Friday 18 April 2014

How To Build VTK In Windows


Before building VTK some requirements need to be meet. As per my system:
  • VTK 5.x.x
  • QT 4.8.4 (If you require QVTK)
  • Cmake 2.8.12
  • Visual Studio 2010
* *Please note that all of the above versions should be either 32 bit or 64 bit.

Step 1: Download the latest VTK source and data from this link.
Step 2: Extract them under the directory C:/VTK. VTK source -> vtk-5.x.x and VTK data-> vtkdata-5.x.x. 
Step 3: Open your Cmake GUI.
  • set Where is the source code to C:/VTK/vtk-5.x.x
  • set Where to build the binaries to C:/VTK
Step 4: Click Configure. Select Visual Studio 10 (if 32 bit) or Visual Studio 10 64bit (if 64 bit)
Step 5: After a while a window with some red line appear. Uncheck BUILD_SHARED_LIBS, check VTK_USE_QT and BUILD_EXAMPLE. Set VTK_DATA_ROOT = "C:/VTK/vtkdata-5.x.x".
Step 6: Click Configure again. Click Generate.
Step 7: Open your Visual Studio in Administrative mode. Open VTK.sln inside your C:/VTK directory.
Step 8: Configure your building mode to debug if you want to build in debug mode otherwise do the same for release mode.
Step 9: In the Solution Explorer right click on INSTALL and then click Build. It will take time to build the VTK. After completion you will find the library inside your program files/VTK.

That's all!!!
Thanks.
Contact Me if any problem occurs.