From 246501450edb9a793e2c72404681089b61fdf135 Mon Sep 17 00:00:00 2001
From: Stephen Sorley <Stephen.Sorley@jhuapl.edu>
Date: Wed, 17 Feb 2016 14:19:27 -0500
Subject: [PATCH] Fixed Visual Studio CUDA compile failure.

The failure was caused by incorrect escaping of double quotes around
$(VCInstallDir) when add_custom_command() is used with VERBATIM.
---
 Modules/FindCUDA.cmake | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 1674e2d..97da680 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1175,7 +1175,8 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
   # -ccbin or --compiler-bindir isn't used and CUDA_HOST_COMPILER matches
   # $(VCInstallDir)/bin.
   if(CMAKE_GENERATOR MATCHES "Visual Studio")
-    set(ccbin_flags -D "\"CCBIN:PATH=$(VCInstallDir)bin\"" )
+    get_filename_component(_vcbindir "${CMAKE_CXX_COMPILER}" DIRECTORY)
+    set(ccbin_flags -D "CCBIN:PATH=${_vcbindir}" )
   else()
     set(ccbin_flags)
   endif()
-- 
1.9.1

