mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 11:49:55 -06:00
FindCUDA: Use find_program instead of find_path to find nvcc
Otherwise nvcc is not found if it is in env PATH but a non-standard location.
This commit is contained in:
@@ -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_path(CUDA_TOOLKIT_ROOT_DIR
|
||||
find_program(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_path(CUDA_TOOLKIT_ROOT_DIR
|
||||
find_program(CUDA_TOOLKIT_ROOT_DIR
|
||||
NAMES nvcc nvcc.exe
|
||||
PATHS /opt/cuda/bin
|
||||
PATH_SUFFIXES cuda/bin
|
||||
|
||||
Reference in New Issue
Block a user