So, if you already have a binary, you can add an rpath to it on OSX using the 'install_name_tool', as so:
install_name_tool -add_rpath @executable_path/blah
xcode does this automatically when you're building an application bundle.
I know that in cmake you can use this to set the install_name of the shared library:
set_target_properties(nshared PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@rpath")
My question is, what's the equivalent of this to add an rpath to a binary?
(for the 'why would you do that?' amongst you, go look at the otool -l on any of the apps in your Applications/ folder and you'll see plenty of apps with entries like:
Load command 15
cmd LC_RPATH
cmdsize 36
path @executable_path/../../Frameworks/
This is standard practice. I'm just trying to do it in cmake)