CMake : vtk_module_autoinit

I encountered this problem: CMake Error at CMakeLists.txt:47 (vtk_module_autoinit):
Unknown CMake command “vtk_module_autoinit”.
How to deal with it?
I use CMake 3.20.5 and vtk9.03, and I want to use qt GUI.

This is more of a VTK question, but I’d be the one to answer it over there. What project are you trying to build?

I want to build the project file of the VTK9.0.3 example :examples->GUI->Qt->FourPaneViewer for VS2019.
Thank you Ben.

Hmm. That’s really odd. Can you use --debug-find to see what VTK it ends up finding? No VTK should pass that find_package(VTK) call and not have vtk_module_autoinit defined.

Thank you so much Ben.
Excuse me for my so late reply.
As you said That’s really odd.
After several months, the problem disappeared.
But you remind me that the problem may be caused by the VTK version.
I have a VTK5.10 on my system. If I change VTK to this version, the problem comes up.
So the problem must be caused by me.