CUDA: Fix user-set architectures during detection with Visual Studio

If the user specifies CMAKE_CUDA_ARCHITECTURES we use those during detection
and error out if they don't work.
For Visual Studio a dummy project file is used instead of invoking the compiler
directly. NVCC would thus use its default and we'd fail if
CMAKE_CUDA_ARCHITECTURES was anything other than NVCC's default.

Use the necessary project file variable in CMakeDetermineCompilerId.cmake to
match other generators.

Fixes #21492.
1 file changed