macro(fix_cudart_rpath target)
if (ENABLE_CUDA AND APPLE)
get_target_property(_target_exe ${target} LOCATION)
add_custom_command(TARGET ${target} POST_BUILD
                          COMMAND install_name_tool ARGS -change @rpath/libcudart.dylib ${CUDA_CUDART_LIBRARY} ${_target_exe})
add_custom_command(TARGET ${target} POST_BUILD
                          COMMAND install_name_tool ARGS -change @rpath/libcufft.dylib ${CUDA_CUDART_EMU_LIBRARY} ${_target_exe})
endif (ENABLE_CUDA AND APPLE)
endmacro(fix_cudart_rpath)

macro(fix_cudart_rpath target)
if (ENABLE_CUDA AND APPLE)
get_target_property(_target_exe ${target} LOCATION)
add_custom_command(TARGET ${target} POST_BUILD
                          COMMAND install_name_tool ARGS -change @rpath/libcudart.dylib ${CUDA_CUDART_LIBRARY} ${_target_exe})
add_custom_command(TARGET ${target} POST_BUILD
                          COMMAND install_name_tool ARGS -change @rpath/libcufft.dylib ${CUDA_cufft_LIBRARY} ${_target_exe})
endif (ENABLE_CUDA AND APPLE)
endmacro(fix_cudart_rpath)

Fix bug that prevented mac os x builds from running in the build directory
Fix bug that prevented mac os x builds from running in the build directory


git-svn-id: 4ba210d0a933e3fb1aa9ab096f190cd38965d92a@3903 fa922fa7-2fde-0310-acd8-f43f465a7996
