FindCUDA: Revert "Use find_program instead of find_path to find nvcc"

Revert commit 067ee518f7 (FindCUDA: Use find_program instead of
find_path to find nvcc, 2019-10-31).  It causes `CUDA_TOOLKIT_ROOT_DIR`
to contain the path to nvcc rather than the toolkit directory.
This commit is contained in:
Brad King
2019-11-04 14:49:53 -05:00
parent 067ee518f7
commit f4eebeb447

View File

@@ -676,7 +676,7 @@ endif()
# Search for the cuda distribution.
if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING)
# Search in the CUDA_BIN_PATH first.
find_program(CUDA_TOOLKIT_ROOT_DIR
find_path(CUDA_TOOLKIT_ROOT_DIR
NAMES nvcc nvcc.exe
PATHS
ENV CUDA_TOOLKIT_ROOT
@@ -688,7 +688,7 @@ if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING)
)
# Now search default paths
find_program(CUDA_TOOLKIT_ROOT_DIR
find_path(CUDA_TOOLKIT_ROOT_DIR
NAMES nvcc nvcc.exe
PATHS /opt/cuda/bin
PATH_SUFFIXES cuda/bin