您的位置:首页 > 编程语言 > Qt开发

VTK6.2 Qt5.4.0 VS2013

2015-11-19 21:46 585 查看


Building VTK6 + Qt5 with Visual Studio


Download

Download VTK 6.1.0 the (VTK-6.1.0.zip) to unzip the file. (C: \ VTK-6.1.0)Http://Www.Vtk.Org/VTK/resources/software.Html#latestcand 
Https://Github.Com/Kitware/VTK/tree/v6.1.0
Qt 5.4.0 with OpenGLをダウンロード、インストールする。(C:\Qt)
http://www.qt.io/download-open-source/#

Qt 5.4.0 for Windows 32-bit (VS 2013, OpenGL, 694 MB)

(qt-opensource-windows-x86-msvc2013_opengl-5.4.0.exe)
Qt 5.4.0 for Windows 64-bit (VS 2013, OpenGL, 709 MB)

(qt-opensource-windows-x86-msvc2013_64_opengl-5.4.0.exe)


CMake

You want to specify the destination of the input destination and solution files of source code.
Where is the source code: C:\VTK-6.1.0
Where is build the binaries: C:\VTK-6.1.0\build

Press the [Configure] to select the Visual Studio that is the target.
It makes various settings.

(Grouped and helpful to put a check to Advanced.) * Win32 is Msvc2013_opengl , x64 is msvc2013_64_openglspecified in. Ungrouped Entries

Qt5Core_DIR C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/lib/cmake/Qt5Core
Qt5Designer_DIR C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/lib/cmake/Qt5Designer
Qt5Gui_DIR C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/lib/cmake/Qt5Gui
Qt5Network_DIR C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/lib/cmake/Qt5Network
Qt5OpenGL_DIR C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/lib/cmake/Qt5OpenGL
Qt5Sql_DIR C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/lib/cmake/Qt5Sql
Qt5WebKit_DIR C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/lib/cmake/Qt5WebKit
Qt5WebKitWidgets_DIRC:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/lib/cmake/Qt5WebKitWidgets
Qt5Widgets_DIR C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/lib/cmake/Qt5Widgets
Qt5Xml_DIR C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/lib/cmake/Qt5Xml

BUILD
BUILD_SHAREED_LIBS 

 (check)
BUILD_TESTING ☐ (uncheck)

CMAKE
CMAKE_CONFIGURATION_TYPES Debug;Release
CMAKE_INSTALL_PREFIX C:\Program Files\VTK (or C:\Program Files (x86)\VTK)

Module
Module_vtkGUISupportQt 

 (check)
Module_vtkGUISupportQtOpenGL 

 (check)
Module_vtkGUISupportQtSQL 

 (check)
Module_vtkGUISupportQtWebkit 

 (check)
Module_vtkRenderingQt 

 (check)
Module_vtkViewsQt 

 (check)

OPENGL
OPENGL_gl_LIBRARY opengl
OPENGL_glu_LIBRARY glu32

QT
QT_MKSPECS_DIR C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/mkspecs/win32-msvc2013
QT_QMAKE_EXECUTABLE C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/bin/qmake.exe
QT_QTCORE_LIBRARY_DEBUG C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/lib/Qt5Cored.lib
QT_QTCORE_LIBRARY_DEBUG C:/Qt/Qt5.4.0/5.4/msvc2013_64_opengl/lib/Qt5Core.lib

VTK
VTK_Group_Qt 

 (check)
VTK_INSTALL_QT_PLUGIN_DIR ${CMAKE_INSTALL_PREFIX}/${VTK_INSTALL_QT_DIR}
VTK_QT_VERSION 5

Press the [Add Entry] to add the following settings.
Name:CMAKE_PREFIX_PATH
Type:PATH
Value:C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64

(or C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86)
Description: 
* Windows Kits path if Visual Studio 2013 8.1 \ Lib \ Winv6.3, if Visual Studio 2012 8.0 I specify the \ Lib \ Win8.
Name:CMAKE_DEBUG_POSTFIX
Type:STRING
Value:-gd
Description: 
* Debug string to be added to the file name of the build generated files of the (last).

And output the solution file by pressing the [Generate].


Build

Start Visual Studio with administrative privileges VTK solution file (C: \ VTK-6.1.0 \ build \ VTK.sln) to open.

(If you do not start with administrator privileges Visual Studio INSTALL to fail.)
It wants to build the VTK. (ALL_BUILD)
The configuration of the solution (Debug, Release) set the.
Choose the ALL_BUILD project from Solution Explorer.
[Build]> to build VTK Press [Build Solution].

It wants to install the VTK. (INSTALL)
Choose the INSTALL project from Solution Explorer.

build\GUISupport\Qt\PluginInstall.cmake

5 line

IF(BUILD_TYPE MATCHES Debug)
SET(VTK_INSTALL_QT_PLUGIN_FILE "QVTKWidgetPlugin-gd.dll")
ELSE()
SET(VTK_INSTALL_QT_PLUGIN_FILE "QVTKWidgetPlugin.dll")
ENDIF()


[Build]> [projects only]> to install the VTK Press [INSTALL only the Build menu.CMAKE_INSTALL_PREFIX necessary files are copied to the specified output destination.

https://hemprasad.wordpress.com/2015/04/30/building-vtk-with-visual-studio-2013/

https://gist.github.com/UnaNancyOwen/77d61f9f21376c9b59fc
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: