summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-08-01 17:47:56 (GMT)
committerBrad King <brad.king@kitware.com>2018-08-01 17:47:56 (GMT)
commitc7769867d6e195b5361c77ea54393c9cfaa12f94 (patch)
tree54b052af402248c9d0f245c40510278c364befb1 /Modules
parent3bab41f8f2971d3aa9fa40beb7263de8f340f1e9 (diff)
parent37ba34c0b0270a09ca935d271f1742aea219070f (diff)
downloadCMake-c7769867d6e195b5361c77ea54393c9cfaa12f94.zip
CMake-c7769867d6e195b5361c77ea54393c9cfaa12f94.tar.gz
CMake-c7769867d6e195b5361c77ea54393c9cfaa12f94.tar.bz2
Merge branch 'cuda-arch-version' into release-3.12
Merge-request: !2251
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindCUDA/select_compute_arch.cmake5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake
index 22c04df..cf4fc39 100644
--- a/Modules/FindCUDA/select_compute_arch.cmake
+++ b/Modules/FindCUDA/select_compute_arch.cmake
@@ -18,8 +18,9 @@
#
if(CMAKE_CUDA_COMPILER_LOADED) # CUDA as a language
- if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
- set(CUDA_VERSION "${CMAKE_CUDA_COMPILER_VERSION}")
+ if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA"
+ AND CMAKE_CUDA_COMPILER_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
+ set(CUDA_VERSION "${CMAKE_MATCH_1}")
endif()
endif()