So, if you already have the binary, you can add the path to OSX to it using "install_name_tool", since:
install_name_tool -add_rpath @executable_path/blah
xcode does this automatically when you create an application package.
I know that in cmake you can use this to set the page_name of the shared library:
set_target_properties(nshared PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@rpath")
My question is: what is the equivalent of this for adding rpath to binary?
(for “why do you do this?” among you, look at otool -l on any of the applications in your Applications / folder, and you will see many applications with entries such as:
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)
cmake macos
Doug
source share