mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-29 04:09:35 +03: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:
@@ -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