diff options
author | Brad King <brad.king@kitware.com> | 2020-04-15 13:36:16 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-04-15 13:36:24 (GMT) |
commit | 17e6666a43079b2fed4b62b8a0105429ddea8d9a (patch) | |
tree | a787c7422fdf130780fc6c68587186ef0d017997 | |
parent | 40e043eb98539e4f94fb8bcf290aee4b43864c3e (diff) | |
parent | 4f1e24efa05b4a2482e00115608e0f8db28997a7 (diff) | |
download | CMake-17e6666a43079b2fed4b62b8a0105429ddea8d9a.zip CMake-17e6666a43079b2fed4b62b8a0105429ddea8d9a.tar.gz CMake-17e6666a43079b2fed4b62b8a0105429ddea8d9a.tar.bz2 |
Merge topic 'FindCUDAToolkit-search-stubs' into release-3.17
4f1e24efa0 FindCUDAToolkit searches stub location last
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4589
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index 4b14ddc..de7e785 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -711,8 +711,15 @@ find_path(CUDAToolkit_INCLUDE_DIR # And find the CUDA Runtime Library libcudart find_library(CUDA_CUDART NAMES cudart - PATH_SUFFIXES lib64 lib64/stubs lib/x64 + PATH_SUFFIXES lib64 lib/x64 ) +if (NOT CUDA_CUDART) + find_library(CUDA_CUDART + NAMES cudart + PATH_SUFFIXES lib64/stubs lib/x64/stubs + ) +endif() + if (NOT CUDA_CUDART AND NOT CUDAToolkit_FIND_QUIETLY) message(STATUS "Unable to find cudart library.") endif() @@ -759,9 +766,20 @@ if(CUDAToolkit_FOUND) NAMES ${search_names} HINTS ${CUDAToolkit_LIBRARY_DIR} ENV CUDA_PATH - PATH_SUFFIXES nvidia/current lib64 lib64/stubs lib/x64 lib lib/stubs + PATH_SUFFIXES nvidia/current lib64 lib/x64 lib ${arg_EXTRA_PATH_SUFFIXES} ) + # Don't try any stub directories intil we have exhausted all other + # search locations. + if(NOT CUDA_${lib_name}_LIBRARY) + find_library(CUDA_${lib_name}_LIBRARY + NAMES ${search_names} + HINTS ${CUDAToolkit_LIBRARY_DIR} + ENV CUDA_PATH + PATH_SUFFIXES lib64/stubs lib/x64/stubs lib/stubs stubs + ) + endif() + mark_as_advanced(CUDA_${lib_name}_LIBRARY) if (NOT TARGET CUDA::${lib_name} AND CUDA_${lib_name}_LIBRARY) |