summaryrefslogtreecommitdiffstats
path: root/Tests/Cuda
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2022-11-30 14:49:52 (GMT)
committerBrad King <brad.king@kitware.com>2022-11-30 21:39:00 (GMT)
commit9d012b1f69c5bcc0fc1ee9452340f490dd2881d9 (patch)
tree1ad12226587c3020f92ffe2f908de54e46d37f21 /Tests/Cuda
parentf72c405d4ee4ad4775a10a944774b91f49726dad (diff)
downloadCMake-9d012b1f69c5bcc0fc1ee9452340f490dd2881d9.zip
CMake-9d012b1f69c5bcc0fc1ee9452340f490dd2881d9.tar.gz
CMake-9d012b1f69c5bcc0fc1ee9452340f490dd2881d9.tar.bz2
FindCUDAToolkit: Ensure that paths provided have no symlinks
Fixes: #24188
Diffstat (limited to 'Tests/Cuda')
-rw-r--r--Tests/Cuda/Toolkit/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/Tests/Cuda/Toolkit/CMakeLists.txt b/Tests/Cuda/Toolkit/CMakeLists.txt
index 4df29fa..e6b298d 100644
--- a/Tests/Cuda/Toolkit/CMakeLists.txt
+++ b/Tests/Cuda/Toolkit/CMakeLists.txt
@@ -30,6 +30,8 @@ endif()
foreach (cuda_lib IN LISTS cuda_libs)
if(NOT CUDA_${cuda_lib}_LIBRARY)
message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found")
+ elseif(CUDA_${cuda_lib}_LIBRARY MATCHES [[\.\./]])
+ message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY[\"${CUDA_${cuda_lib}_LIBRARY}\"] to not contain /..")
endif()
if(NOT TARGET CUDA::${cuda_lib})
message(FATAL_ERROR "expected CUDAToolkit target CUDA::${cuda_lib} not found")
@@ -41,6 +43,9 @@ if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 11)
list(APPEND npp_libs nppicom)
endif()
foreach (cuda_lib IN LISTS npp_libs)
+ if(CUDA_${cuda_lib}_LIBRARY MATCHES [[\.\./]])
+ message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY[\"${CUDA_${cuda_lib}_LIBRARY}\"] to not contain /..")
+ endif()
if(NOT TARGET CUDA::${cuda_lib})
message(FATAL_ERROR "The CUDA::${cuda_lib} target was expected but couldn't be found")
endif()