summaryrefslogtreecommitdiffstats
path: root/Modules/FindCUDA.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-03-22 15:04:14 (GMT)
committerBrad King <brad.king@kitware.com>2016-03-22 15:05:02 (GMT)
commit72a97b7a761b46fd1668e3ae81dd9322972f4cb3 (patch)
tree3b14a28d3cb25bdbf2742166738b707559ca7532 /Modules/FindCUDA.cmake
parent1911cda03efc71f97e610e0b593282c835f2d4f4 (diff)
downloadCMake-72a97b7a761b46fd1668e3ae81dd9322972f4cb3.zip
CMake-72a97b7a761b46fd1668e3ae81dd9322972f4cb3.tar.gz
CMake-72a97b7a761b46fd1668e3ae81dd9322972f4cb3.tar.bz2
FindCUDA: Fix regression in separate compilation (#16027)
Since commit v3.5.0-rc1~47^2 (FindCUDA: Support special characters in path, 2016-01-15) our add_custom_command calls use VERBATIM so that CMake will automatically quote special characters correctly. Fix the separate compilation code path to not add its own quoting when the VERBATIM option will be used.
Diffstat (limited to 'Modules/FindCUDA.cmake')
-rw-r--r--Modules/FindCUDA.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 47c03f3..fe8b18e 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1551,7 +1551,12 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
list( FIND nvcc_flags "-ccbin" ccbin_found0 )
list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 )
if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER )
- list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"")
+ # Match VERBATIM check below.
+ if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)")
+ list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"")
+ else()
+ list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}")
+ endif()
endif()
# Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS*