diff options
author | Brad King <brad.king@kitware.com> | 2010-06-22 13:57:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-06-22 13:57:29 (GMT) |
commit | 22301dd9e7fbdb87991c45d964b30b2a0a4b5d08 (patch) | |
tree | d864f80148a2cbc6691591f274fffe7428105663 | |
parent | 0336d822cc6b337ae0c1bdf45bc939d64d58c900 (diff) | |
parent | 1d5554201f725d3158e05c1a91ff09fab1633b26 (diff) | |
download | CMake-22301dd9e7fbdb87991c45d964b30b2a0a4b5d08.zip CMake-22301dd9e7fbdb87991c45d964b30b2a0a4b5d08.tar.gz CMake-22301dd9e7fbdb87991c45d964b30b2a0a4b5d08.tar.bz2 |
Merge branch 'FixCudaVersionAfterFirstRun'
-rw-r--r-- | Modules/FindCUDA.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 6539057..17da9e9 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -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 |