From d9c1f05924239fafc159ed0b24ecdc24228c8e34 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Thu, 18 Jun 2020 20:03:25 +0300 Subject: CUDA: Fix NVCC executable search during compiler detection The result variable was `CUDAToolkit_NVCC_EXECUTABLE` instead of `_CUDA_NVCC_EXECUTABLE`, which the rest of the code used. Also, we can simply `set()` the `_CUDA_NVCC_EXECUTABLE` value without searching. Fixes: #20847 --- Modules/CMakeDetermineCUDACompiler.cmake | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index e12da45..335305e 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -76,13 +76,7 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) # For NVCC we can easily deduce the SDK binary directory from the compiler path. if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") - get_filename_component(_CUDA_BIN_DIR "${CMAKE_CUDA_COMPILER}" DIRECTORY) - find_program(CUDAToolkit_NVCC_EXECUTABLE - NAMES nvcc nvcc.exe - PATHS ${_CUDA_BIN_DIR} - NO_DEFAULT_PATH - ) - unset(_CUDA_BIN_DIR) + set(_CUDA_NVCC_EXECUTABLE "${CMAKE_CUDA_COMPILER}") endif() # Search using CUDAToolkit_ROOT and then CUDA_PATH for equivalence with FindCUDAToolkit. -- cgit v0.12