VTK/Building/Linux

From KitwarePublic
Jump to navigationJump to search

Download

Download the source code from the VTK Download page or Clone with Git

git clone git://vtk.org/VTK.git VTK

Configure

mkdir VTK-build
cd VTK-build
ccmake ../VTK

Set any options you would like using the curses interface. Alternatively, set the options at the command line.

mkdir VTK-Release-build
cd VTK-Release-build
cmake -DCMAKE_BUILD_TYPE:STRING=Release /path/to/VTK

Qt Setup

Qt5

In order to build with the latest Qt5 release (Qt5.2.1), take the following steps:

mkdir qt5.2.1-install && cd qt5.2.1-install
wget http://download.qt-project.org/official_releases/qt/5.2/5.2.1/qt-opensource-linux-x64-5.2.1.run
chmod +x qt-opensource-linux-x64-5.2.1.run
./qt-opensource-linux-x64-5.2.1.run
  • Install to a directory
  • Configure with the following options
cmake -DVTK_QT_VERSION:STRING=5 \
      -DQT_QMAKE_EXECUTABLE:PATH=/path/to/qt5.2.1-install/5.2.1/gcc_64/bin/qmake \
      -DVTK_Group_Qt:BOOL=ON \
      -DCMAKE_PREFIX_PATH:PATH=/path/to/qt.5.2.1-install/5.2.1/gcc_64/lib/cmake  \
      -DBUILD_SHARED_LIBS:BOOL=ON
      /path/to/VTK

Build

Once cmake finishes successfully configuring, use make inside the build directory.

make -j<# of cores>