-
Download vtk-5.10.1.tar.gz fromhttp://vtk.org/VTK/resources/software.html#latestand extract;
-
$cd/home/chen/Downloads/VTK5.10.1/
-
$mkdir VTKBin
-
$cd VTKBin
-
$cmake ..
-
$ccmake ..
configure as follows:
press c to configure, and press g togenerate and exit;
- $make
- copy the include files andlibraries to system directories: $sudo make install
- 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})
########################################################