summaryrefslogtreecommitdiffstats
path: root/Modules/FindCUDAToolkit.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindCUDAToolkit.cmake')
-rw-r--r--Modules/FindCUDAToolkit.cmake15
1 files changed, 9 insertions, 6 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index 9cf7e29..7fd0401 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -965,12 +965,15 @@ if(CUDAToolkit_FOUND)
# search paths without symlinks
if(CUDAToolkit_LIBRARY_DIR MATCHES ".*/cuda/${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}/lib64$")
# Search location for math_libs/
- file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../../../" _cmake_search_dir)
- list(APPEND CUDAToolkit_LIBRARY_SEARCH_DIRS "${_cmake_search_dir}")
-
- # Search location for extras like cupti
- file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../" _cmake_search_dir)
- list(APPEND CUDAToolkit_LIBRARY_SEARCH_DIRS "${_cmake_search_dir}")
+ block(SCOPE_FOR POLICIES)
+ cmake_policy(SET CMP0152 NEW)
+ file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../../../../../" _cmake_search_dir)
+ list(APPEND CUDAToolkit_LIBRARY_SEARCH_DIRS "${_cmake_search_dir}")
+
+ # Search location for extras like cupti
+ file(REAL_PATH "${CUDAToolkit_LIBRARY_DIR}/../../../" _cmake_search_dir)
+ list(APPEND CUDAToolkit_LIBRARY_SEARCH_DIRS "${_cmake_search_dir}")
+ endblock()
endif()
# If no `CUDAToolkit_LIBRARY_ROOT` exists set it based on CUDAToolkit_LIBRARY_DIR