This warning is for project developers. Use -Wno-dev to suppress it.
Try adding that to your command line when you invoke CMake (or to the C++ flags in the toolchain file and/or the appropriate CMakeLists.txt file.

I am pretty sure that the term "project developers" refers to the developers of Qt itself, not people using Qt to develop their own projects.

I am not using Qt6 yet, so don't have the CMake files to look at. Maybe there is some other reader here who can give more advice.