From 6f707ab541c92a4c53f06553963474a1ede98a62 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 9 Nov 2022 16:04:00 -0500 Subject: FindCUDAToolkit: Support math_libs directory being a symlink Fixes #24140 --- Modules/FindCUDAToolkit.cmake | 4 ++-- 1 file 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}\"") -- cgit v0.12