Running cmake with Ninja generator from the Visual Studio Command Prompt should look like the following image. CMake should automatically find the Visual Studio 2022 compiler.