diff options
author | Raul Tambre <raul@tambre.ee> | 2020-06-12 17:42:09 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2020-06-12 18:49:15 (GMT) |
commit | 9c4397212721a2f18d31ac739d4c3ad9eebafada (patch) | |
tree | 67322cae5912f47336aed2a3ee12bcc4f8a3d350 /Modules | |
parent | 9eebb5b8b264cad7240d1af515113ca5f2c4ffad (diff) | |
download | CMake-9c4397212721a2f18d31ac739d4c3ad9eebafada.zip CMake-9c4397212721a2f18d31ac739d4c3ad9eebafada.tar.gz CMake-9c4397212721a2f18d31ac739d4c3ad9eebafada.tar.bz2 |
FindCUDAToolkit: Avoid unnecessary temporary variable computing binary dir
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index b4661fb..594b513 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -479,10 +479,9 @@ Result variables # For NVCC we can easily deduce the SDK binary directory from the compiler path. if(CMAKE_CUDA_COMPILER_LOADED AND NOT CUDAToolkit_BIN_DIR AND CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") - get_filename_component(cuda_dir "${CMAKE_CUDA_COMPILER}" DIRECTORY) - set(CUDAToolkit_BIN_DIR "${cuda_dir}" CACHE PATH "") + get_filename_component(CUDAToolkit_BIN_DIR "${CMAKE_CUDA_COMPILER}" DIRECTORY) + set(CUDAToolkit_BIN_DIR "${CUDAToolkit_BIN_DIR}" CACHE PATH "") mark_as_advanced(CUDAToolkit_BIN_DIR) - unset(cuda_dir) endif() # Try language- or user-provided path first. @@ -602,10 +601,9 @@ if(NOT CUDAToolkit_NVCC_EXECUTABLE) endif() if(NOT CUDAToolkit_BIN_DIR AND CUDAToolkit_NVCC_EXECUTABLE) - get_filename_component(cuda_dir "${CUDAToolkit_NVCC_EXECUTABLE}" DIRECTORY) - set(CUDAToolkit_BIN_DIR "${cuda_dir}" CACHE PATH "" FORCE) + get_filename_component(CUDAToolkit_BIN_DIR "${CUDAToolkit_NVCC_EXECUTABLE}" DIRECTORY) + set(CUDAToolkit_BIN_DIR "${CUDAToolkit_BIN_DIR}" CACHE PATH "" FORCE) mark_as_advanced(CUDAToolkit_BIN_DIR) - unset(cuda_dir) endif() get_filename_component(CUDAToolkit_ROOT_DIR ${CUDAToolkit_BIN_DIR} DIRECTORY ABSOLUTE) |