diff options
author | Chuck Atkins <chuck.atkins@kitware.com> | 2016-06-13 13:39:15 (GMT) |
---|---|---|
committer | Chuck Atkins <chuck.atkins@kitware.com> | 2016-06-14 13:55:35 (GMT) |
commit | 90d114ed8c724ca49fa02444dd59d06fd9806f3b (patch) | |
tree | e8def3caf84c6f911a23526e9e00dd12250cec45 /Modules | |
parent | 06ee543c00971cd6d52a41da146fdbc9317fd5f7 (diff) | |
download | CMake-90d114ed8c724ca49fa02444dd59d06fd9806f3b.zip CMake-90d114ed8c724ca49fa02444dd59d06fd9806f3b.tar.gz CMake-90d114ed8c724ca49fa02444dd59d06fd9806f3b.tar.bz2 |
FindCUDA: Use the correct runtime in REQUIRED_VARS check
When enabling the CUDA static runtime, the current module always uses
the shared runtime in the REQUIRED_VARS check. This change should
select the correct runtime to be checked for as required based on the
CUDA_USE_STATIC_CUDA_RUNTIME option.
Fixes #16096
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindCUDA.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 86f89d8..81fc7a8 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -787,8 +787,10 @@ endif() if(CUDA_cudart_static_LIBRARY) # Set whether to use the static cuda runtime. option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) + set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) else() option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" OFF) + set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) endif() if(CUDA_USE_STATIC_CUDA_RUNTIME) @@ -1003,7 +1005,7 @@ find_package_handle_standard_args(CUDA CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS - CUDA_CUDART_LIBRARY + ${CUDA_CUDART_LIBRARY_VAR} VERSION_VAR CUDA_VERSION ) |