Merge branch 'FixCudaVersionAfterFirstRun'

This commit is contained in:
Brad King 2010-06-22 09:57:29 -04:00
commit 22301dd9e7
1 changed files with 4 additions and 0 deletions

View File

@ -484,6 +484,10 @@ if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION)
string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT})
set(CUDA_VERSION "${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}" CACHE STRING "Version of CUDA as computed from nvcc.")
mark_as_advanced(CUDA_VERSION)
else()
# 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]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}")
endif()
# Always set this convenience variable