summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2022-11-09 21:04:00 (GMT)
committerRobert Maynard <rmaynard@nvidia.com>2022-11-09 21:04:00 (GMT)
commit6f707ab541c92a4c53f06553963474a1ede98a62 (patch)
tree590c5a4ebf3fb3e136e102456b457fb803b34805 /Modules
parent16cb04dbe9448554c97f407af38c1df1a2f3f953 (diff)
downloadCMake-6f707ab541c92a4c53f06553963474a1ede98a62.zip
CMake-6f707ab541c92a4c53f06553963474a1ede98a62.tar.gz
CMake-6f707ab541c92a4c53f06553963474a1ede98a62.tar.bz2
FindCUDAToolkit: Support math_libs directory being a symlink
Fixes #24140
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindCUDAToolkit.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index 94c86e9..365b72a 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -834,8 +834,8 @@ endif()
# The NVHPC layout moves math library headers and libraries to a sibling directory.
# Create a separate variable so this directory can be selectively added to math targets.
if(NOT EXISTS "${CUDAToolkit_INCLUDE_DIR}/cublas_v2.h")
- set(CUDAToolkit_MATH_INCLUDE_DIR "${CUDAToolkit_TARGET_DIR}/../../math_libs/include")
- cmake_path(NORMAL_PATH CUDAToolkit_MATH_INCLUDE_DIR)
+ file(REAL_PATH "${CUDAToolkit_TARGET_DIR}/../../" CUDAToolkit_MATH_INCLUDE_DIR)
+ cmake_path(APPEND CUDAToolkit_MATH_INCLUDE_DIR "math_libs/include")
if(NOT EXISTS "${CUDAToolkit_MATH_INCLUDE_DIR}/cublas_v2.h")
if(NOT CUDAToolkit_FIND_QUIETLY)
message(STATUS "Unable to find cublas_v2.h in either \"${CUDAToolkit_INCLUDE_DIR}\" or \"${CUDAToolkit_MATH_INCLUDE_DIR}\"")