Compile VTK

Unzip the VTK source on your hard drive. Create a build_x64/build_x86 folder and execute than CMake with this two folders.

  • Uncheck BUILD_EXAMPLES, BUILD_TESTING, HDF5_USE_FOLDERS, HDF5_EMBEEDDED_LIBINFO

  • Check BUILD_SHARED_LIBS

  • Check Module_vtkGUISupportQt, Module_vtkGUISupportQtOpenGL, Module_vtkGUISupportQtSQL, Module_vtkRenderingQT and Module_vtkViewsQt.

  • Add a new entry: name = “CMAKE_DEBUG_POSTFIX”, type = “STRING” with the value = “-gd”

  • Add a new entry: name = “VTK_USE_QT”, type = “BOOL” with the value = checked

  • Add a new entry: name = “VTK_USE_GUISUPPORT”, type = “BOOL” with the value = checked

  • Change CMAKE_INSTALL_PREFIX to ${MAINDIR}/3rdPartyPCL/vtk8.2.0

  • If an error occures with wrong Qt Version, change VTK_QT_VERSION to 5

  • Choose with the variable VTK_RENDERING_BACKEND which OpenGL is used for VTK/PCL.

  • Set the Entry Qt5_DIR to to ${MAINDIR}/3rdParty/Qt5.12.1/msvc2017_64/lib/cmake/Qt5.

  • Check VTK_BUILD_QT_DESIGNER_PLUGIN.

Note

Check the Entries Qt5_DIR, Qt5Core_DIR, Qt5Sql_DIR, …, if they are set to the right path.

Warning

  1. Before starting the compilation open in the folder VTK\build\GUISupport\Qt

    the PluginInstall.cmake file and change in line 5 “QVTKWidgetPlugin.dll” to “QVTKWidgetPlugin-gd.dll”

  2. Start DEBUG compilation in Visual Studio

  3. Change the “QVTKWidgetPlugin-gd.dll” back to “QVTKWidgetPlugin.dll”

    and start RELEASE compilation

Warning

If VTK returns the warning message: QVTKWIDGET was deprecated for VTK 8.2 and will be removed in a future version., open the vtkSetGet.h file of the VTK source files and comment the line 910 vtkGenericWarningMacro.