1

I compiled VTK in my RedHat 8.3 machine, and now when I want to compile an example in the /GUI/Qt/SimpleView with cmake I get the following error message when configuring:

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. 

Has anyone encountered this problem before ?

Thank you for your help.

5
  • removed the word "compilation" from your title, because this is not a compile-time thing, but a configure-time thing. Commented Apr 10, 2022 at 14:36
  • well, have you install the VTK devel package? Commented Apr 10, 2022 at 14:36
  • 1
    During CMake configuration of VTK, did you set the "VTK_MODULE_ENABLE_VTK_GuiSupportQt" and "VTK_MODULE_ENABLE_VTK_ViewsQt" options to "YES"? Commented Apr 10, 2022 at 14:36
  • @MarcusMüller I just compile VTK from the source. I don't know if the devel package has been installed. What can I do to know if the package has been installed. Commented Apr 10, 2022 at 14:42
  • you don't need the devel package if you have compiled it yourself. your own build is enough Commented Apr 10, 2022 at 14:43

1 Answer 1

2

This looks like you did not set the VTK_MODULE_ENABLE_VTK_GuiSupportQt and VTK_MODULE_ENABLE_VTK_ViewsQt options to "YES" when running configure in CMake.

Note: the abovementioned option names are only applicable for VTK >= 9; for VTK < 9, they are called Module_vtkGUISupportQt and Module_vtkViewsQt (and you might also need to enable Module_vtkGUISupportQtOpenGL and Module_vtkRenderingQt).

These options are not enabled by default, but they seem to be required by the example that you're trying to compile.

Don't worry, you shouldn't have to re-do everything now. To fix:

  • Open the CMake GUI.
  • Enter the folder where you built VTK in "Where to build the binaries".
  • If it's not checked, set the "Advanced" checkbox (the required options are not visible otherwise).
  • Set VTK_MODULE_ENABLE_VTK_GuiSupportQt and VTK_MODULE_ENABLE_VTK_ViewsQt options to "YES"
  • Press "Configure", and wait for it to finish
  • During Configuring, you might get an error, if CMake doesn't know how to find Qt; if so, enter the Qt5_DIR / Qt6_DIR, and press configure again.
  • Press "Generate", and wait for it to finish
  • Start the vtk build again (depends on what build tool you choose...)
  • Try configuring the example again, now you should not see the error message anymore.
Sign up to request clarification or add additional context in comments.

5 Comments

Thank you. Your answer solves my problem.
Hi I have the same issue too I dont know how should I Set VTK_MODULE_ENABLE_VTK_GuiSupportQt and VTK_MODULE_ENABLE_VTK_ViewsQt options to "YES" ? I didnt underestand what should I do.
I should click on Add Entry if yes I do that but it didnt build
No it should already be in the (name, value) list of options below the "search" input field. make sure you have the "advanced" checkbox checked, as stated above, otherwise the option won't be visible. you can also use the search input field - just type Qt into the field, and the visible options will get filtered down to all options affecting vtk's Qt support
also make sure you are actually building VTK 9. For VTK < 9, the options have a different name

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.