summaryrefslogtreecommitdiffstats
path: root/Modules/FindCUDAToolkit.cmake
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-06-12 17:39:25 (GMT)
committerRaul Tambre <raul@tambre.ee>2020-06-12 18:49:15 (GMT)
commit9eebb5b8b264cad7240d1af515113ca5f2c4ffad (patch)
treec01a805c2c08c58d06e9f90ca40c3d521af5525f /Modules/FindCUDAToolkit.cmake
parent8f01fe7bf139b019eaff5594b558b17862cfab37 (diff)
downloadCMake-9eebb5b8b264cad7240d1af515113ca5f2c4ffad.zip
CMake-9eebb5b8b264cad7240d1af515113ca5f2c4ffad.tar.gz
CMake-9eebb5b8b264cad7240d1af515113ca5f2c4ffad.tar.bz2
FindCUDAToolkit: Remove unnecessary checks around searches
find_*() don't search if the result variable is already set. Remove the if()s around such cases.
Diffstat (limited to 'Modules/FindCUDAToolkit.cmake')
-rw-r--r--Modules/FindCUDAToolkit.cmake26
1 files changed, 11 insertions, 15 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index 84bcf34..b4661fb 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -697,12 +697,10 @@ find_library(CUDA_CUDART
NAMES cudart
PATH_SUFFIXES lib64 lib/x64
)
-if(NOT CUDA_CUDART)
- find_library(CUDA_CUDART
- NAMES cudart
- PATH_SUFFIXES lib64/stubs lib/x64/stubs
- )
-endif()
+find_library(CUDA_CUDART
+ NAMES cudart
+ PATH_SUFFIXES lib64/stubs lib/x64/stubs
+)
if(NOT CUDA_CUDART AND NOT CUDAToolkit_FIND_QUIETLY)
message(STATUS "Unable to find cudart library.")
@@ -753,16 +751,14 @@ if(CUDAToolkit_FOUND)
PATH_SUFFIXES nvidia/current lib64 lib/x64 lib
${arg_EXTRA_PATH_SUFFIXES}
)
- # Don't try any stub directories intil we have exhausted all other
+ # Don't try any stub directories until we have exhausted all other
# search locations.
- if(NOT CUDA_${lib_name}_LIBRARY)
- find_library(CUDA_${lib_name}_LIBRARY
- NAMES ${search_names}
- HINTS ${CUDAToolkit_LIBRARY_DIR}
- ENV CUDA_PATH
- PATH_SUFFIXES lib64/stubs lib/x64/stubs lib/stubs stubs
- )
- endif()
+ find_library(CUDA_${lib_name}_LIBRARY
+ NAMES ${search_names}
+ HINTS ${CUDAToolkit_LIBRARY_DIR}
+ ENV CUDA_PATH
+ PATH_SUFFIXES lib64/stubs lib/x64/stubs lib/stubs stubs
+ )
mark_as_advanced(CUDA_${lib_name}_LIBRARY)