# How to build and test VTK with Qt ?

**URL:** https://discourse.vtk.org/t/how-to-build-and-test-vtk-with-qt/11087
**Category:** Support
**Created:** [March 28, 2023, 7:30pm UTC](https://discourse.vtk.org/t/how-to-build-and-test-vtk-with-qt/11087 "2023-03-28T19:30:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![fghoussen](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/f/ecd19e/32.png) [@fghoussen](https://discourse.vtk.org/u/fghoussen)
#### Post date: [March 28, 2023, 7:30pm UTC](https://discourse.vtk.org/t/how-to-build-and-test-vtk-with-qt/11087/1 "2023-03-28T19:30:32Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [March 30, 2023, 10:51pm UTC](https://discourse.vtk.org/t/how-to-build-and-test-vtk-with-qt/11087/2 "2023-03-30T22:51:48Z")

</div>

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

---

<div class="post-metadata">

### Author: ![fghoussen](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/f/ecd19e/32.png) [@fghoussen](https://discourse.vtk.org/u/fghoussen)
#### Post date: [March 31, 2023, 3:47pm UTC](https://discourse.vtk.org/t/how-to-build-and-test-vtk-with-qt/11087/3 "2023-03-31T15:47:25Z")

</div>

> [@Paulo\_Carvalho](#):
>
> CMake only configures your build,

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
