summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly/WithDefs
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-06-21 13:35:16 (GMT)
committerBrad King <brad.king@kitware.com>2017-06-21 14:41:49 (GMT)
commitfff782f6a64a64538254b23891dc00b18ecec4fe (patch)
tree3a291de2cc28ce0c66af0e2744ad4ed0bb82722f /Tests/CudaOnly/WithDefs
parentad4a68cca00af3a20caaafbb96be67a1cc53a027 (diff)
downloadCMake-fff782f6a64a64538254b23891dc00b18ecec4fe.zip
CMake-fff782f6a64a64538254b23891dc00b18ecec4fe.tar.gz
CMake-fff782f6a64a64538254b23891dc00b18ecec4fe.tar.bz2
Tests: Simplify CUDA rpath on macOS
Use the `BUILD_RPATH` property and reference the CMake-computed location of the runtime libraries.
Diffstat (limited to 'Tests/CudaOnly/WithDefs')
-rw-r--r--Tests/CudaOnly/WithDefs/CMakeLists.txt7
1 files changed, 3 insertions, 4 deletions
diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt
index 38f2a44..fe0ccc6 100644
--- a/Tests/CudaOnly/WithDefs/CMakeLists.txt
+++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt
@@ -36,8 +36,7 @@ target_compile_definitions(CudaOnlyWithDefs
$<$<CONFIG:RELEASE>:$<BUILD_INTERFACE:${release_compile_defs}>>
)
-#we need to add an rpath for the cuda library so that everything
-#loads properly on the mac
-if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
- set_target_properties(CudaOnlyWithDefs PROPERTIES LINK_FLAGS "-Wl,-rpath,${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}")
+if(APPLE)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET CudaOnlyWithDefs PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
endif()