Software preparation:
1. Download the source code compression package VTK-7.0.0.zip from the VTK official website and extract it.
2. Download the installation package QT-Opensource-Windows-x86-MSVC2012_OpenGL-5.3.2. exe from the Qt official website, and install it by default.
3. Download the installation package cmake-3.0.2-win32-x86.exe from the official website of CMake, and install it by default.
Cmake set
1. Check Groupd and Advanced, and set the source code directory and build directory.
2. Press the Configure button, select VisualStudio 11 2012, click OK, and wait for the configuration to complete.
3. At the VTK node, locate and check VTK_GROUP_QT. Press the Configure button and wait for the configuration to complete. When done, CMake will report an error and click OK.
4. In the UngroundedEntries node with a red background, locate and change the value of VTK_QT_VERSION to 5. Set the value of QT_QMAKE_EXECUTABLE to C:/Qt/Qt5.3.2/5.3/msvc2012_opengl/bin/qmake. Exe. Press the Configure button and wait for the configuration to complete. When done, CMake will report an error and click OK.
5. In the UngroundedEntries node with red background, set the value of Qt5_DIR to C:/Qt/ qt5.3.2/5.3/msvc2012_opengl/lib/cmake/Qt5. Press the Configure button and wait for the configuration to complete. When done, CMake will no longer report errors.
6. On the CMAKE node, locate the CMAKE_INSTALL_PREFIX node and use the default Settings. This value is the installation directory of the VTK after compilation.
7. Click Add Entry button, set Name to CMAKE_DEBUG_POSTFIX, Type to STRING, Value to -GD, and click OK after setting. Press the Configure button and wait for the configuration to complete. Set this to ensure that the debug version of lib, DLL and release version of lib, the DLL name is different, to prevent later installation, both overwrite.
8. Click the Generate button and wait for the project VS file to be generated.
9. Locate the plugininstall. cmake file in the GUISupport\Qt folder of the build directory. Open it with Notepad and take line 5
SET (VTK_INSTALL_QT_PLUGIN_FILE QVTKWidgetPlugin. DLL)
Replace with
IF(BUILD_TYPE MATCHES Debug)
SET (VTK_INSTALL_QT_PLUGIN_FILE “QVTKWidgetPlugin – gd. DLL)”
ELSE()
SET (VTK_INSTALL_QT_PLUGIN_FILE QVTKWidgetPlugin. DLL)
ENDIF()
Note: Make sure that qvtkwidgetPlugin-gd.dll and qvtkwidgetPlugin.dll are surrounded by double quotation marks after substitution. Otherwise, subsequent compilation will return an error.
Save. This modification can prevent the QVTKWidgetPlugin file from being found when installing Qt plugin during debugging.
1. Download the source code compression package VTK-7.0.0.zip from the VTK official website and extract it.
2. Download the installation package QT-Opensource-Windows-x86-MSVC2012_OpenGL-5.3.2. exe from the Qt official website, and install it by default.
3. Download the installation package cmake-3.0.2-win32-x86.exe from the official website of CMake, and install it by default.
Cmake set
1. Check Groupd and Advanced, and set the source code directory and build directory.
2. Press the Configure button, select VisualStudio 11 2012, click OK, and wait for the configuration to complete.
3. At the VTK node, locate and check VTK_GROUP_QT. Press the Configure button and wait for the configuration to complete. When done, CMake will report an error and click OK.
4. In the UngroundedEntries node with a red background, locate and change the value of VTK_QT_VERSION to 5. Set the value of QT_QMAKE_EXECUTABLE to C:/Qt/Qt5.3.2/5.3/msvc2012_opengl/bin/qmake. Exe. Press the Configure button and wait for the configuration to complete. When done, CMake will report an error and click OK.
5. In the UngroundedEntries node with red background, set the value of Qt5_DIR to C:/Qt/ qt5.3.2/5.3/msvc2012_opengl/lib/cmake/Qt5. Press the Configure button and wait for the configuration to complete. When done, CMake will no longer report errors.
6. On the CMAKE node, locate the CMAKE_INSTALL_PREFIX node and use the default Settings. This value is the installation directory of the VTK after compilation.
7. Click Add Entry button, set Name to CMAKE_DEBUG_POSTFIX, Type to STRING, Value to -GD, and click OK after setting. Press the Configure button and wait for the configuration to complete. Set this to ensure that the debug version of lib, DLL and release version of lib, the DLL name is different, to prevent later installation, both overwrite.
8. Click the Generate button and wait for the project VS file to be generated.
9. Locate the plugininstall. cmake file in the GUISupport\Qt folder of the build directory. Open it with Notepad and take line 5
SET (VTK_INSTALL_QT_PLUGIN_FILE QVTKWidgetPlugin. DLL)
Replace with
IF(BUILD_TYPE MATCHES Debug)
SET (VTK_INSTALL_QT_PLUGIN_FILE “QVTKWidgetPlugin – gd. DLL)”
ELSE()
SET (VTK_INSTALL_QT_PLUGIN_FILE QVTKWidgetPlugin. DLL)
ENDIF()
Note: Make sure that qvtkwidgetPlugin-gd.dll and qvtkwidgetPlugin.dll are surrounded by double quotation marks after substitution. Otherwise, subsequent compilation will return an error.
Save. This modification can prevent the QVTKWidgetPlugin file from being found when installing Qt plugin during debugging.
VS2012 compilation
1. Run VS as an administrator, click File, Open, and the dialog box pops up. Find the vtk.sln file in the path and open it.
2. In Solution Manager, go to ALL_BUILD, right-click, and click Build. Wait for VS to compile. When finished, find Install, click the right mouse button, and click Create.
3. Change the solution configuration to Release. In Solution Manager, go to ALL_BUILD, right-click, and click Build. Wait for VS to compile. When finished, find Install, click the right mouse button, and click Create.
4. After the above steps are completed, the compiled file will be in the path set by CMAKE_INSTALL_PREFIX.
Read More:
- Vs2017 compiles pcl1.8.1 with vtk8.0 and uses qt5.9.5
- Summary of problems encountered in compiling and installing vtk7 + vs2013 / 2015 + cmake
- PCL environment configuration (pcl1.8.1, vs2017, win10)
- [VTK] cmake compiling VTK
- PCL environment construction (PCL 1.8.1 + vs 2017)
- Vtk7. X is compiled and installed under vs2013 and vs2015
- Qt5 when compiling VTK_ The solution of dir-notfound
- Solutions to several VTK compilation errors (vtk5.8 + VS2010)
- Vs2015 configuring OpenGL development environment: configuration of glfw library and glad Library
- [VTK] vtk8.2.0 + vs2015 + win10 compilation and configuration
- Vs2013 compiling ffmpeg
- Vtk8.0 compilation process record under vs2017 and qt5.12.1
- Error in compiling pcl1.9.1: “class vtkdatasetmapper” has no member named “immediatemode rendering off”
- Vs2015 + PCL. 1.8.1 (win10) environment configuration
- Pcl1.9 + vs2017 + win10 installation instructions and MFC adaptation
- Vs configuration of OpenGL development environment: configuration of glfw library and glad Library
- Problems in compiling VTK with cmake: solutions to error configuration process, project files may be invalid
- VTK + QT + vs compilation and installation configuration
- Vs2015 compiling ffmpeg source code
- Vtk8.2.0 (32bit + 64bit) compilation and installation test (win10 + vs2017 + Qt5)