summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-02-17 20:25:44 (GMT)
committerBrad King <brad.king@kitware.com>2016-02-17 20:25:44 (GMT)
commit3dd420bd9029488a73bc10bde75d6499ac75267d (patch)
tree72c6b0a670ee274b4d03acdf39cdb09c71d70f8b
parentef10f5259a26adb13baf002649328b9c6bb5bfd7 (diff)
parent1911cda03efc71f97e610e0b593282c835f2d4f4 (diff)
downloadCMake-3dd420bd9029488a73bc10bde75d6499ac75267d.zip
CMake-3dd420bd9029488a73bc10bde75d6499ac75267d.tar.gz
CMake-3dd420bd9029488a73bc10bde75d6499ac75267d.tar.bz2
Merge branch 'FindCUDA-verbatim' into release
-rw-r--r--Modules/FindCUDA.cmake16
1 files changed, 13 insertions, 3 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 1674e2d..47c03f3 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1456,6 +1456,11 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}")
endif()
+ set(_verbatim VERBATIM)
+ if(ccbin_flags MATCHES "\\$\\(VCInstallDir\\)")
+ set(_verbatim "")
+ endif()
+
# Build the generated file and dependency file ##########################
add_custom_command(
OUTPUT ${generated_file}
@@ -1474,7 +1479,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
-P "${custom_target_script}"
WORKING_DIRECTORY "${cuda_compile_intermediate_directory}"
COMMENT "${cuda_build_comment_string}"
- VERBATIM
+ ${_verbatim}
)
# Make sure the build system knows the file is generated.
@@ -1586,6 +1591,11 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
set(do_obj_build_rule FALSE)
endif()
+ set(_verbatim VERBATIM)
+ if(nvcc_flags MATCHES "\\$\\(VCInstallDir\\)")
+ set(_verbatim "")
+ endif()
+
if (do_obj_build_rule)
add_custom_command(
OUTPUT ${output_file}
@@ -1593,7 +1603,7 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file}
${flags}
COMMENT "Building NVCC intermediate link file ${output_file_relative_path}"
- VERBATIM
+ ${_verbatim}
)
else()
get_filename_component(output_file_dir "${output_file}" DIRECTORY)
@@ -1603,7 +1613,7 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}"
COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}"
- VERBATIM
+ ${_verbatim}
)
endif()
endif()