mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 13:27:09 +00:00
FindCUDAToolkit: Avoid error when nvcc is found without the whole toolkit
Since commit 507b641639 (FindCUDAToolkit: Add cufilt target for CUDA
11.4 and above, 2026-05-27, v4.4.0-rc1~62^2) we try to construct an
imported target for `cufilt` whenever `nvcc` is found even if the
toolkit is not found. Fix conditions to avoid that.
This commit is contained in:
1 parent
76395764c7
commit
96782dad33
1 file changed
+4
-4
@@ -1560,6 +1560,10 @@ if(CUDAToolkit_FOUND)
|
||||
|
||||
_CUDAToolkit_find_and_add_import_lib(OpenCL)
|
||||
|
||||
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.4)
|
||||
_CUDAToolkit_find_and_add_import_lib(cufilt)
|
||||
endif()
|
||||
|
||||
find_program(CUDA_bin2c_EXECUTABLE
|
||||
NAMES bin2c
|
||||
HINTS ${CUDAToolkit_BIN_DIR}
|
||||
@@ -1591,10 +1595,6 @@ if(CUDAToolkit_FOUND)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.4)
|
||||
_CUDAToolkit_find_and_add_import_lib(cufilt)
|
||||
endif()
|
||||
|
||||
if(_CUDAToolkit_Pop_ROOT_PATH)
|
||||
list(REMOVE_AT CMAKE_FIND_ROOT_PATH 0)
|
||||
unset(_CUDAToolkit_Pop_ROOT_PATH)
|
||||
|
||||
Reference in new issue
Block a user