CUDA compile problems on Windows, Cmake error: No CUDA toolset found

I have tried it on a different PC now and it works fine. So I had absolutely no idea why it's not working on this one. As CUDA_PATH is correctly setup in my system variables.

Then looking into it further, by uninstalling the 'Build Tools' of Visual Studio and only having the Community IDE installed, CMake used the IDE instead of the Build Tools and then it started working fine.

Look at this. It may solve your issues. https://gitlab.kitware.com/cmake/cmake/issues/19029

Seems like Nvidia cuda installer has some issues with installing the VS integration with vs 2017. Check if you can find this file in your vs installing path.

C:/Program Files (x86)/Microsoft Visual 
Studio/2017/Professional/Common7/IDE/VC/VCTargets/BuildCustomizations/CUDA 
10.1.xml