How to build and test VTK with Qt ?

How to build and test VTK with Qt ?

~/build> cmake -DVTK_GROUP_ENABLE_Qt=YES -DVTK_BUILD_EXAMPLES=ON …

But <VTK_ROOT>/Examples/GUI/Qt/SimpleView/CMakeLists.txt has not been compiled: I can not test / run SimpleView example.

Hello,

Running CMake only configures your build, that is: populates a build folder with the necessary files for generation, compilation and deployment. You still need to generate an usable Makefile, VS solution or whetever your toolset understands to build VTK. After that, you start compilation by running, for example, make -j 10 (for GCC-like compilers, using up to 10 processes in parallel) in the build directory (where you run cmake ...) to actually build your project. Finally, you run a make install (again, in the build directory) to deploy the built artifacts (libraries, executables, link-time libraries, etc.) to the configured target folder (with the CMAKE_INSTALL_PREFIX CMake variable).

take care,

Paulo

Got SimpleView example to run.

  1. build vTK from source
  2. then each sample (like SimpleView) seems to have it’s own CMakeLists.txt: each sample needs to be compiled individually pointing to the VTK install created at step 1
1 Like