Building VTK

First always build with shared libraries wherever possible.

There are a number of non-default settings that I use when building VTK which are

Here are the settings I use when building VTK:

BUILD_EXAMPLES OFF (Optional)
BUILD_SHARED_LIBS ON
CMAKE_BUILD_TYPE RelWithDebInfo (Optional)
CMAKE_CXX_COMPILER g++
VTK_USE_HYBRID ON
VTK_USE_PARALLEL OFF
VTK_USE_PATENTED ON
VTK_USE_RENDERING ON
VTK_WRAP_* ON (Your preferences)
CMAKE_CXX_FLAGS -Wno-deprecated
CMAKE_SKIP_RPATH ON
VTK_USE_SYSTEM_* ON

It is best to do an out-of-tree build and not build in the source tree.

For VTK I perform the following steps

cd VTK-4.2.2
mkdir Build
cd Build
ccmake ..

# Then set your configuration options...

make
su -c "make install"

Then to clean up after the build, simply 'rm -rf Build'.



Building ITK

For building ITK, I use the following settings:

BUILD_EXAMPLES OFF
BUILD_SHARED_LIBS ON
BUILD_TESTING OFF
CMAKE_BUILD_TYPE RelWithDebInfo
CMAKE_CXX_COMPILER g++
CMAKE_SKIP_RPATH ON
ITK_USE_SYSTEM_* ON

For compiling ITK I perform the following steps

cd ITK
mkdir Build
cd Build
ccmake ..

# Then set your configuration options...

make su -c "make install"