diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2021-02-08 16:37:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-02-09 14:39:20 (GMT) |
commit | cd89d1c328439709eb090e099774bbb6ddf8eb95 (patch) | |
tree | ab54414e545d79be1757a3217a903b9297c0a0ae /Tests/Cuda | |
parent | b06a480b5726a44cefb98cf84f0d874c37d1a95c (diff) | |
download | CMake-cd89d1c328439709eb090e099774bbb6ddf8eb95.zip CMake-cd89d1c328439709eb090e099774bbb6ddf8eb95.tar.gz CMake-cd89d1c328439709eb090e099774bbb6ddf8eb95.tar.bz2 |
FindCUDAToolkit: Robust version checks when CUDA lang is not enabled
Previously if you set `CMAKE_CUDA_COMPILER` but hadn't enabled
the CUDA language, FindCUDAToolkit would not correctly compute
the version information.
Diffstat (limited to 'Tests/Cuda')
-rw-r--r-- | Tests/Cuda/Toolkit/CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/Cuda/Toolkit/CMakeLists.txt b/Tests/Cuda/Toolkit/CMakeLists.txt index 00125e3..8b42296 100644 --- a/Tests/Cuda/Toolkit/CMakeLists.txt +++ b/Tests/Cuda/Toolkit/CMakeLists.txt @@ -5,6 +5,10 @@ project(Toolkit CXX) # Validate that we can use CUDAToolkit to find cuda include paths find_package(CUDAToolkit REQUIRED) +if(NOT DEFINED CUDAToolkit_VERSION) + message(FATAL_ERROR "expected CUDAToolkit variable CUDAToolkit_VERSION not found") +endif() + message(STATUS "CUDAToolkit_VERSION: ${CUDAToolkit_VERSION}") message(STATUS "CUDAToolkit_VERSION_MAJOR: ${CUDAToolkit_VERSION_MAJOR}") message(STATUS "CUDAToolkit_VERSION_MINOR: ${CUDAToolkit_VERSION_MINOR}") |