'Generating build files for different visual studio versions

I recently moved to VS2022 and uninstalled VS2019. However, I need to generate some build files in VS2019. When I try to do so, I get this error

CMake Error at CMakeLists.txt:2 (project):
  Generator

    Visual Studio 16 2019

  could not find any instance of Visual Studio.

So my question is since I currently have VS2022, can I generate VS2019 build files?

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source