1 macro(fix_cudart_rpath target)
2 if (ENABLE_CUDA AND APPLE)
3 get_target_property(_target_exe ${target} LOCATION)
4 add_custom_command(TARGET ${target} POST_BUILD
5 COMMAND install_name_tool ARGS -change @rpath/libcudart.dylib ${CUDA_CUDART_LIBRARY} ${_target_exe})
6 add_custom_command(TARGET ${target} POST_BUILD
7 COMMAND install_name_tool ARGS -change @rpath/libcufft.dylib ${CUDA_cufft_LIBRARY} ${_target_exe})
8 endif (ENABLE_CUDA AND APPLE)
9 endmacro(fix_cudart_rpath)