Tag Archives: QT5.9.5

Vs2017 compiles pcl1.8.1 with vtk8.0 and uses qt5.9.5

Package version and download address:

Qt5.9.5 (msvc2017-64)

http://download.qt.io/archive/qt/5.9/5.9.5/qt-opensource-windows-x86-5.9.5.exe

VS2017

Microsoft’s official website

VTK – 8.0.0 https://download.csdn.net/download/u013598629/10683029

Cmake – 3.12.2

https://cmake.org/download/
Local Directory Description:

pcl1.8.1 installation directory

E: \ pcl1.8.1

Qt5.9.5 MSVC – 64 – bit directory

E: \ Qt \ Qt5.9.5\5.9.5 \ msvc2017_64

vtk8.0.0 Extract the directory

E: \ VTK – v8.0.0

vtk8.0.0 build directory

E: \ VTK – v8.0.0 \ build

vtk8.0.0 The install directory

E: \ PCL1.8.1\3 rdparty \ VTK
Cmake Settings:
[1. Set the source directory is the vtk8.0.0 decompression directory ] and generated directory [is the build directory].
2. Click Add Entry,Name is CMAKE_DEBUG_POSTFIX, Type is String, Value is -GD, and click OK. This is to separate the final generated debug from the release version of the lib.

3. Click Configure, select VisualStudio 15 2017 Win64, and click Finish to wait for the configuration to complete.
After some time, the configuration is finished, and a configuration list will appear. Follow these steps to configure it
BUILD options
BUILD_EXAMPLES, build_shared_libs, BUILD_TESTING
Just tick build_shared_libs, and the other two are up to the individual to select, so it’s a lot faster at compile time, so I just tick build_shared_libs.

VTK installation directory
CMAKE_INSTALL_POSTFIX- Set to the vtk8.0.0 install directory described in the local directory above

VTK_Group_Qt

Click Configure and wait for the configuration to finish.
After some time, more configuration options will appear, and then follow the following steps to configure them.
1. Modify Qt5_DIR to E:\Qt\Qt5.9.5\5.9.5\msvc2017_64\lib\cmake\Qt5.
2. Set VKT_QT_VERSION to 5. Click Configure again to continue.

Generate engineering
After the configuration is successful, a Configuring Done prompt appears. Click Generate to build the project. If Generating Done appears, you can click Open Project. VTK. SLN will be opened in VS2017.

First, configure the solution to Debug in VS2017. 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
Switch 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.
After the above steps are completed, the compiled file will be placed under the path set by CMAKE_INSTALL_PREFIX.
Then put the QVTKWidgetPlugin.dll in the E:\vtk-v8.0.0\ Build \bin\Release directory
Copy to E:\Qt\Qt5.9.5\5.9.5\msvc2017_64\plugins\designer.
At this point, open the Designer again and you will see the QVTKWidget.