Building VTK with Qt6

Hello, i have been trying to build vtk with qt6 gui support, but when generating project, cmake allways fails.

CMake err CMake Warning at CMake/vtkModule.cmake:4787 (find_package): Could not find a configuration file for package “Qt6” that is compatible with requested version “5.9”.

The following configuration files were considered but not accepted:

C:/.conan/a815ad/1/build/generators/Qt6Config.cmake, version: 6.6.0

Call Stack (most recent call first): GUISupport/Qt/CMakeLists.txt:43 (vtk_module_find_package)

CMake Error at CMake/vtkModule.cmake:4793 (message): Could not find the Qt6 external dependency. Call Stack (most recent call first): GUISupport/Qt/CMakeLists.txt:43 (vtk_module_find_package)

– Configuring incomplete, errors occurred!

Iam not sure why qt gui support tries to find Qt event with qt6 specified, but with version 5.9 (maybe from qt5 days?)

Build settings: VTK_SMP_IMPLEMENTATION_TYPE=sequential VTK_QT_VERSION=6 VTK_GROUP_ENABLE_Qt=YES VTK_GROUP_ENABLE_Rendering=YES VTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES VTK_MODULE_ENABLE_VTK_GUISupportQtQuick=DONT_WANT

Thanks for reply!

Please make sure that you have all the necessary Qt libraries installed. VTK needs Qt6Widgets, Qt6OpenGL, Qt6OpenGLWidgets at a minimum.