Could not find the VTK package with the following required components:GuiSupportQt, ViewsQt


I just compile VTK 9.1.0 on RedHat version 8.3 and I try to compile the SimpleView example.

I have this message error but I don’t know how I can solve it.

CMake Warning at CMakeLists.txt:4 (find_package):
Found package configuration file:
but it set VTK_FOUND to FALSE so package “VTK” is considered to be NOT FOUND.
Reason given by package:
Could not find the VTK package with the following required components:
GUISupportQt, ViewsQt.

Qt version 5.15.2 is installed on my computer.

Has anyone encountered this problem before ?

Thank you for your help.

Set your environment variable:
export VTK_DIR=/VTK-installation-folder/lib/cmake/vtk-9.1

make sure that it is right by typing:
echo $VTK_DIR

Hope this helps

VTK_DIR was good, I solved my problem by set VTK_MODULE_ENABLE_VTK_GuiSupportQt and VTK_MODULE_ENABLE_VTK_ViewsQt options to “YES” when I ran configure in CMake

excuse me, I wander how to set VTK_MODULE_ENABLE_VTK_GuiSupportQt ?

  1. as per go to your VTK build directory, from there open ccmake ../path/to/vtk/source.
  2. now the VTK_MODULE_ENABLE_VTK_GUISupportQt variable is hidden by default; hit the T key to see all variables
  3. then you can search for variables by pressing / and entering a sub-string of your variabel; so maybe /GUISupportQt (beware: the search is case sensitive)
  4. select the variable and hit enter until it shows “YES”

Then C for configure → G for generate and then you can re-build your VTK with your usual make command