VTK Installation and Configuration with Qt in Ubuntu

来源:互联网 发布:mysql exists 编辑:程序博客网 时间:2024/05/17 23:27
  1. Download vtk-5.10.1.tar.gz fromhttp://vtk.org/VTK/resources/software.html#latestand extract;

  2. $cd/home/chen/Downloads/VTK5.10.1/

  3. $mkdir VTKBin

  4. $cd VTKBin

  5. $cmake ..

  6. $ccmake ..

    configure as follows:


      press c to configure, and press g togenerate and exit;

  7. $make
  8. copy the include files andlibraries to system directories: $sudo make install
  9. copy the plugin to qt:

$cd /usr/lib/qt4

sudo mkdir plugins

cd plugins

sudo mkdir designer

sudo cp~/Downloads/VTK5.10.1/VTKBin/bin/libQVTKWidgetPlugin.so/usr/lib/qt4/plugins/designer

open qtcreator (can be installedfrom Ubuntu Software Center) create one Gui application and open the ui by qtdesigner tocheck QVTKWidget.



To use VTK in your own project, addfollowing to the CMakeLists.txt in your project:

########################################################

#VTK

#set(VTK_DIR"~/Downloads/vtk/VTK5.10.1/build")

set(VTK_DIR "/usr/local/lib/vtk-5.10")

find_package(VTK REQUIRED)

include(${VTK_USE_FILE})

########################################################


    原创粉丝点击