Skip to content

Commit 1cba763

Browse files
committed
fix build error of automatic CC detection
1 parent d321a34 commit 1cba763

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmake/OpenCVDetectCUDA.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ if(CUDA_FOUND)
101101
else()
102102
set(CC_LIST ${ARGN})
103103
foreach(target_arch ${CC_LIST})
104-
string(REPLACE "." "" target_arch_short ${target_arch})
104+
string(REPLACE "." "" target_arch_short "${target_arch}")
105105
set(NVCC_OPTION "-gencode;arch=compute_${target_arch_short},code=sm_${target_arch_short}")
106106
execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" ${NVCC_OPTION} "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu"
107107
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
@@ -111,7 +111,7 @@ if(CUDA_FOUND)
111111
set(${result_list} "${${result_list}} ${target_arch}")
112112
endif()
113113
endforeach()
114-
string(STRIP ${${result_list}} ${result_list})
114+
string(STRIP "${${result_list}}" ${result_list})
115115
set(CUDA_SUPPORTED_CC ${${result_list}} CACHE INTERNAL "List of supported compute capability")
116116
endif()
117117
endmacro()
@@ -124,7 +124,7 @@ if(CUDA_FOUND)
124124
endmacro()
125125

126126
macro(ocv_wipeout_deprecated _arch_bin_list)
127-
string(REPLACE "2.1" "2.1(2.0)" ${_arch_bin_list} ${${_arch_bin_list}})
127+
string(REPLACE "2.1" "2.1(2.0)" ${_arch_bin_list} "${${_arch_bin_list}}")
128128
endmacro()
129129

130130
set(__cuda_arch_ptx "")

0 commit comments

Comments
 (0)