summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2022-11-02 16:13:41 (GMT)
committerRobert Maynard <rmaynard@nvidia.com>2022-11-02 16:23:30 (GMT)
commit62f13ed588da428699d84a7e61b6d33b3563a374 (patch)
treed372ab05ef3dc47cb0871f1fc8ecd9ea3590f1c6 /Modules
parent301815eb6243c7598c246d06524cff51f7e90576 (diff)
downloadCMake-62f13ed588da428699d84a7e61b6d33b3563a374.zip
CMake-62f13ed588da428699d84a7e61b6d33b3563a374.tar.gz
CMake-62f13ed588da428699d84a7e61b6d33b3563a374.tar.bz2
FindCUDAToolkit: Restore usage from multiple directories
Fixes #24119
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindCUDAToolkit.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index b019f0b..94c86e9 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -1058,8 +1058,10 @@ if(CUDAToolkit_FOUND)
_CUDAToolkit_find_and_add_import_lib(nvrtc DEPS cuda_driver)
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.1.0)
- _CUDAToolkit_find_and_add_import_lib(nvptxcompiler_static DEPS cuda_driver)
- target_link_libraries(CUDA::nvptxcompiler_static INTERFACE Threads::Threads)
+ if(NOT TARGET CUDA::nvptxcompiler_static)
+ _CUDAToolkit_find_and_add_import_lib(nvptxcompiler_static DEPS cuda_driver)
+ target_link_libraries(CUDA::nvptxcompiler_static INTERFACE Threads::Threads)
+ endif()
endif()
_CUDAToolkit_find_and_add_import_lib(nvml ALT nvidia-ml nvml)