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

Hi,

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:
home/user/Downloads/VTK-9.1.0/build/lib64/cmake/vtk-9.1/vtk-config.cmake
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 ?