summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-03-27 17:58:49 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-03-27 17:59:26 (GMT)
commitc126e80b5a7a9cf98ebea7c34a2b5b5f848dfab1 (patch)
tree1d1430ea04fd283dae5bf8df892db869ef57eb57 /Modules
parent3843d0550bf0657b5626d02c4184350c8f26aff5 (diff)
parentb127e0c5610221d10c1d6658db96741ab85a083c (diff)
downloadCMake-c126e80b5a7a9cf98ebea7c34a2b5b5f848dfab1.zip
CMake-c126e80b5a7a9cf98ebea7c34a2b5b5f848dfab1.tar.gz
CMake-c126e80b5a7a9cf98ebea7c34a2b5b5f848dfab1.tar.bz2
Merge topic 'cuda-bracket-output'
b127e0c561 CUDA: Tolerate square brackets in PROMPT environment variable Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3151
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 113b520..490d659 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -111,10 +111,15 @@ elseif(CMAKE_CUDA_COMPILER_ID STREQUAL NVIDIA)
if(_nvcc_libraries)
# Remove variable assignments.
string(REGEX REPLACE "#\\\$ *[^= ]+=[^\n]*\n" "" _nvcc_output "${_nvcc_output_orig}")
+ # Encode [] characters that break list expansion.
+ string(REPLACE "[" "{==={" _nvcc_output "${_nvcc_output}")
+ string(REPLACE "]" "}===}" _nvcc_output "${_nvcc_output}")
# Split lines.
string(REGEX REPLACE "\n+(#\\\$ )?" ";" _nvcc_output "${_nvcc_output}")
foreach(line IN LISTS _nvcc_output)
set(_nvcc_output_line "${line}")
+ string(REPLACE "{==={" "[" _nvcc_output_line "${_nvcc_output_line}")
+ string(REPLACE "}===}" "]" _nvcc_output_line "${_nvcc_output_line}")
string(APPEND _nvcc_log " considering line: [${_nvcc_output_line}]\n")
if("${_nvcc_output_line}" MATCHES "^ *nvlink")
string(APPEND _nvcc_log " ignoring nvlink line\n")