Detect Visual Studio in a way that works correctly with NMake files