diff options
author | Hong Xu <hong@topbug.net> | 2019-08-09 23:37:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-08-20 13:47:29 (GMT) |
commit | 76b76a7f9bdf54c8dc299bd1a9c7bcc0bc9ef005 (patch) | |
tree | 6ae6d85fe98e3d36f7809b742e4a2d525520bd53 /Modules/FindCUDA/run_nvcc.cmake | |
parent | e3746821dfc37c8514c934e1e5d62d0ec99adc9f (diff) | |
download | CMake-76b76a7f9bdf54c8dc299bd1a9c7bcc0bc9ef005.zip CMake-76b76a7f9bdf54c8dc299bd1a9c7bcc0bc9ef005.tar.gz CMake-76b76a7f9bdf54c8dc299bd1a9c7bcc0bc9ef005.tar.bz2 |
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.
Diffstat (limited to 'Modules/FindCUDA/run_nvcc.cmake')
-rw-r--r-- | Modules/FindCUDA/run_nvcc.cmake | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake index 6fc2439..af15d55 100644 --- a/Modules/FindCUDA/run_nvcc.cmake +++ b/Modules/FindCUDA/run_nvcc.cmake @@ -75,7 +75,8 @@ set(CUDA_NVCC_EXECUTABLE "@CUDA_NVCC_EXECUTABLE@") # path set(CUDA_NVCC_FLAGS @CUDA_NVCC_FLAGS@ ;; @CUDA_WRAP_OPTION_NVCC_FLAGS@) # list @CUDA_NVCC_FLAGS_CONFIG@ 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) +string(REPLACE "\\" "/" CUDA_NVCC_INCLUDE_DIRS "${CUDA_NVCC_INCLUDE_DIRS}") 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 |