vs2012 compiling a PCL dependent library VTK7.0

Source: Internet
Author: User
Software Preparation:

1. Download the source code tarball Vtk-7.0.0.zip and unzip it from VTK official website.

2. Download the installation package Qt-opensource-windows-x86-msvc2012_opengl-5.3.2.exe from the QT website and install it by default.

3. Download the installation package Cmake-3.0.2-win32-x86.exe from CMake official website and install it by default. cmake Settings

1. Tick on GROUPD and advanced to set the source code directory and the build directory.

2. Press the Configure button, select VisualStudio 11 2012, click OK button, wait for configuration to complete.

3. On the VTK node, locate and tick the VTK_GROUP_QT. Press the Configure button to wait for the configuration to complete. After completion, CMake will error, click OK.

4. On the Ungroundedentries node with the red background, locate and toggle the Vtk_qt_version value 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 to wait for the configuration to complete. After completion, CMake will error, click OK.

5. On the Ungroundedentries node with the 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 to wait for the configuration to complete. After the completion, CMake will not error.

6. On the CMake node, locate the Cmake_install_prefix node, using the default settings. The value is the installation directory after compilation, VTK.

7. Click the Add Entry button, set the name Cmake_debug_postfix,type to String,value for-GD, and click OK when you are finished. Press the Configure button to wait for the configuration to complete. Set this entry to ensure that the debug version of Lib,dll and release versions lib,dll different names to prevent later installation when both are overwritten.

8. Click the Generate button to wait for the build project vs file.

9. Locate the Plugininstall.cmake file under the Guisupport\qt folder of the generated directory, open it with Notepad, and put the 5th line

SET (vtk_install_qt_plugin_file "QVTKWidgetPlugin.dll")

Replaced by

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: After replacing, make sure Qvtkwidgetplugin-gd.dll and QVTKWidgetPlugin.dll are double quotes, otherwise the compilation will error.

Save. Modified to prevent the subsequent debug, when installing the QT plugin, the report cannot find the Qvtkwidgetplugin file error.

VS2012 Compiling

1. Run as Administrator vs, click File, open, Pop-up dialog, find the VTK.sln file in the path, open.

2. In the solution Manager, locate All_build, right click on Generate. Wait for vs compile to complete. When you are finished, locate the install, right-click and click Generate.

3. Switch the solution configuration to release, in the solution Manager, locate All_build, right click on Generate. Wait for vs compile to complete. When you are finished, locate the install, right-click and click Generate.

4. When the above steps are complete, the compiled file is in the path set by the Cmake_install_prefix.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.