install_name_tool -change /usr/local/lib/testlib.dylib "$TARGET_BUILD_DIR"/../../testlib.dylib "$PRODUCT_NAME"
I was told the above when put into a run script in xcode would change the lookup path of a dynamic library. this can then be verified by entering the following into a terminal window
otool -L /drag/the/executable/here/and/its/filepath/will/show/up/testlib
the output will be something like the following
/previous/filepath:
/usr/local/lib/testlib.dylib (compatibility version 1.0.0, current version 1.0.0)
./anothertestlib.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
My question is why wouldn't the install_name_tool command work? It isn't right now but it did when testlib project was was a target dependancy of a client project. Now I have just dragged the .dylib in to the client project. the lookup path stays in usr/local/lib.
And also, what is usr/local/lib, why does the system think my dylib is in there, and how did it get in there?