summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorPierre Moreau <dev@pmoreau.org>2017-02-02 21:38:32 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-10 18:46:07 (GMT)
commitce19607fed3990b8e828330e77f09061c99aa113 (patch)
tree955a7852bca9f730db14d5ecf7fc0d593b4cd8da /Tests
parent008ed80dcf1d03640879b4168f4fba956aa03196 (diff)
downloadCMake-ce19607fed3990b8e828330e77f09061c99aa113.zip
CMake-ce19607fed3990b8e828330e77f09061c99aa113.tar.gz
CMake-ce19607fed3990b8e828330e77f09061c99aa113.tar.bz2
Tests/Cuda: Fix missing CUDA static library at runtime on macOS
Suggested-by: Robert Maynard
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Cuda/Complex/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/Cuda/Complex/CMakeLists.txt b/Tests/Cuda/Complex/CMakeLists.txt
index 9a3703a..14454cf 100644
--- a/Tests/Cuda/Complex/CMakeLists.txt
+++ b/Tests/Cuda/Complex/CMakeLists.txt
@@ -38,3 +38,9 @@ target_link_libraries(CudaComplexMixedLib
add_executable(CudaComplex main.cpp)
target_link_libraries(CudaComplex PUBLIC CudaComplexMixedLib)
+
+if(APPLE)
+ # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that
+ # the static cuda runtime can find it at runtime.
+ target_link_libraries(CudaComplex PRIVATE -Wl,-rpath,/usr/local/cuda/lib)
+endif()