summaryrefslogtreecommitdiffstats
path: root/Modules/FindCUDA/select_compute_arch.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindCUDA/select_compute_arch.cmake')
-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()