FindCUDAToolkit: Restore use of CUDA_PATH environment variable

Refactoring in commit 7cc815a2a6 (CUDAToolkit: Detect CUDA SDK that
don't have nvcc, 2020-07-24, v3.19.0-rc1~366^2) accidentally broke
use of the `CUDA_PATH` environment variable.

Fixes: #21740
This commit is contained in:
Robert Maynard
2021-02-01 15:05:21 -05:00
committed by Brad King
parent 0c86d15459
commit 4ea6d3c3ae

View File

@@ -561,7 +561,7 @@ else()
_CUDAToolkit_find_root_dir(SEARCH_PATHS "${CUDAToolkit_ROOT}" FIND_FLAGS PATH_SUFFIXES bin NO_DEFAULT_PATH)
endif()
if(NOT CUDAToolkit_ROOT_DIR)
_CUDAToolkit_find_root_dir(FIND_FLAGS PATHS "ENV CUDA_PATH" PATH_SUFFIXES bin)
_CUDAToolkit_find_root_dir(FIND_FLAGS PATHS ENV CUDA_PATH PATH_SUFFIXES bin)
endif()
# If the user specified CUDAToolkit_ROOT but the toolkit could not be found, this is an error.