0

I have to dig up and update an old project that I last worked on about three years ago. It has to run under 10.5 on a PowerPC Mac. I've got a PowerPC Mac running Xcode 3.1.2. The app uses an external framework that's included in the Xcode project as a dependency.

When I try to run the Release version of the app, it isn't finding an embedded framework. I've looked in the application bundle and have verified that the framework is being copied correctly. otool -L tells me it's looking for /Library/Frameworks/SM2DGraphView.framework/Versions/A/SM2DGraphView.

The Debug version of the app, which runs correctly, is looking for (and finding) /Users/hyades/Development/SM2DGraphView 1.6 mine/SM2DGraphView Source/build/Debug/SM2DGraphView.framework/Versions/A/SM2DGraphView.

I have previously-built working copies of the app on both Intel and PowerPC machines and they are both looking in the correct path: @executable_path/../Frameworks/SM2DGraphView.framework/Versions/A/SM2DGraphView.

I've gone to the build settings for the Release configuration and set Framework Search Paths to @executable_path/../Frameworks but otool -L still says it's looking in /Library/Frameworks. How do I get Xcode to tell the app to search for the framework in @executable_path/../Frameworks instead of /Library/Frameworks? I don't remember having to make any specific project settings before. This is not the same machine I originally used for development. Is it possible that it's a global Xcode setting?

SSteve
  • 10,550
  • 5
  • 46
  • 72

1 Answers1

1

I never figured out why the behavior changed, but I did figure out how to fix it. I added a Run Script build phase with this command:

install_name_tool -change /Library/Frameworks/SM2DGraphView.framework/Versions/A/SM2DGraphView @executable_path/../Frameworks/SM2DGraphView.framework/Versions/A/SM2DGraphView $TARGET_BUILD_DIR/$EXECUTABLE_PATH

Now my app looks in its own bundle for the framework.

SSteve
  • 10,550
  • 5
  • 46
  • 72