Commit 76b76a7f authored by Hong Xu's avatar Hong Xu Committed by Brad King

FindCUDA: Fix support for backslashes in CUDA_NVCC_INCLUDE_DIRS

Backslashes in `CUDA_NVCC_INCLUDE_DIRS` cause syntax errors because it
is written to a generated `.cmake` script as a string literal.  Use a
bracket argument to hold the expanded value as we already do for
`CUDA_NVCC_COMPILE_DEFINITIONS`.  Then explicitly convert backslashes to
forward slashes.
parent e3746821
......@@ -75,7 +75,8 @@ set(CUDA_NVCC_EXECUTABLE "@CUDA_NVCC_EXECUTABLE@") # path
set(nvcc_flags @nvcc_flags@) # list
set(CUDA_NVCC_INCLUDE_DIRS "@CUDA_NVCC_INCLUDE_DIRS@") # list (needs to be in quotes to handle spaces properly).
set(CUDA_NVCC_INCLUDE_DIRS [==[@CUDA_NVCC_INCLUDE_DIRS@]==]) # list (needs to be in lua quotes to address backslashes)
set(CUDA_NVCC_COMPILE_DEFINITIONS [==[@CUDA_NVCC_COMPILE_DEFINITIONS@]==]) # list (needs to be in lua quotes see #16510 ).
set(format_flag "@format_flag@") # string
set(cuda_language_flag @cuda_language_flag@) # list
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment