首页 > 其他 > 详细

VTK 6.3.0 Qt 5.4 MinGW 4.9.1 Configuration 配置

时间:2015-10-16 07:38:14      阅读:797      评论:0      收藏:0      [点我收藏+]

 

Download VTK 6.3.0

Download Qt 5.4 with MinGW 4.9.1

Download CMake 3.2.0

 

I assume you‘ve already installed Qt 5.4 with MinGW 4.9.1 and CMake 3.2.0 correctly.

 

Pre-process the VTK:

Open CMakeLists.txt in your extracted VTK-6.3.0 folder, find set(VTK_USE_WIN32_THREADS 1), change it to: set(VTK_USE_PTHREADS 1)

mark_as_advanced(VTK_THREAD_MODEL)
if(CMAKE_USE_WIN32_THREADS_INIT)
  set(VTK_USE_PTHREADS 1)
  set(CMAKE_THREAD_LIBS_INIT "")
elseif(CMAKE_USE_PTHREADS_INIT)
  set(VTK_USE_PTHREADS 1)
  if(CMAKE_HP_PTHREADS_INIT)
    set(VTK_HP_PTHREADS 1)
  endif()
elseif(CMAKE_USE_SPROC_INIT)
  set(VTK_USE_SPROC 1)
endif()
set(CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING "Thread library used.")

 

Open C:\VTK6.3.0\VTK-6.3.0\ThirdParty\libxml2\vtklibxml2\threads.c , add #undef HAVE_WIN32_THREADS after #include "libxml.h"

#define IN_LIBXML
#include "libxml.h"
#undef HAVE_WIN32_THREADS
#include <string.h>

 

Compile the VTK:

Start CMake 3.2.0, fill the source and destination:

技术分享

Click Configure and use MinGW Makefiles to complie.

 

When first configure is done, select Grouped and Advanced.

Go to CMAKE->CMAKE_INSTALL_PREFIX, change the value to C:\VTK6.3.0\MinGW

Go to Module, select Module_vtkGUISupportQtModule_vtkGUISupportQtOpenGLModule_vtkGUISupportQtSQLModule_vtkGUISupportQtWebkitModule_vtkRenderingQtModule_vtkViewsQt

Go to VTK, select VTK_Group_Qt

Go CMake->CMAKE_BUILD_TYPE, change value to Release

Click Add Entry, add QT_QMAKE_EXECUTABLE as Name, PATH as Type, C:/Qt/5.4/mingw491_32/bin/qmake.exe as value:

技术分享

 

Click Add Entry, add CMAKE_PREFIX_PATH as Name, PATH as Type, C:/Qt/5.4/mingw491_32 as value:

技术分享

 

Click Configure again, and you gonna get an error said: "Error in configuration processs, project files may be invalid."

Go to Ungrouped Entries->QT_VTK_VERSION, change value to 5, then click Configure again.

After configure is done, click Generate.

 

Go back to your build folder, open command line, type: mingw32-make

Wait a long time for make process, have a cup of coffee.

After make is done, type mingw32-make install

 

Now, the configuration is done, enjoy it :)

 

Use the VTK:

 

Reference:

http://zhangxc.com/2015/02/qt5-mingw-cmake-vtk6

VTK 6.3.0 Qt 5.4 MinGW 4.9.1 Configuration 配置

原文:http://www.cnblogs.com/grandyang/p/4884184.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!