CMAKE_GENERATOR_TOOLSET with custom CUDA SDK location works only for manually extracted installers
I have been trying to use the new first-class CUDA support with an installation of the SDK in a custom location. Support for such use-case was introduced in !3713 (merged).
Unfortunately the installation isn't correctly detected. If I understand the problem correctly, this is due to the fact that this feature was designed with the layout of a manually extracted installer in mind. This is however different from the file layout after running the installer.
This can be easily checked if you have the CUDA SDK installed on your system. In this case nvcc is located at CUDA_SDK_ROOT_DIR/bin/nvcc.exe. However, in the detection script this is assumed to be located at CUDA_SDK_ROOT_DIR/nvcc/nvcc.exe.
I suppose that fixing this problem requires detecting if the compiler is located in the nvcc or bin folder, and adjust the rest of the hardcoded paths depending on this. For example, the VS integration are located at extras\visual_studio_integration\MSBuildExtensions instead of CUDAVisualStudioIntegration\extras\visual_studio_integration\MSBuildExtensions.