I am able to get nvcc to compile by making a project through Visual Studio, but not by having CMake generate Visual Studio project files. The error occurs on every project including the CUDA CMake sample found here: Building Cross-Platform CUDA Applications with CMake | NVIDIA Technical Blog.
Here is the error: nvcc fatal : Could not set up the environment for Microsoft Visual Studio using ‘C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.37.32822/bin/HostX64/x64/…/…/…/…/…/…/…/VC/Auxiliary/Build/vcvars64.bat’.
How do I resolve this?