CUDA_VERSION variable passed to REGEX needs quotes to work when not defined.

This commit is contained in:
James Bigler 2010-06-15 10:03:40 -06:00
parent 0d30e3fe91
commit 1d5554201f
1 changed files with 2 additions and 2 deletions

View File

@ -486,8 +486,8 @@ if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION)
mark_as_advanced(CUDA_VERSION) mark_as_advanced(CUDA_VERSION)
else() else()
# Need to set these based off of the cached value # Need to set these based off of the cached value
string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR ${CUDA_VERSION}) string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${CUDA_VERSION}")
string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${CUDA_VERSION}) string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}")
endif() endif()
# Always set this convenience variable # Always set this convenience variable