[SDL] SDL & Project Builder

Johannes Fortmann J.Fortmann at gmx.de
Mon Jan 20 17:28:02 PST 2003


Am Montag, 20.01.03 um 15:20 Uhr schrieb Eric Wing:

> Thank you Johannes for the great response. I've also
> been wondering how I will
> ultimately package my SDL based app for OSX without
> making it painful
> for the user to install.
>
> But can you go into a little more detail about how you
> can bundle frameworks inside
> an app using Project Builder? I'm still a little
> confused on the issue.
> I think I see the Targets/Linker section you
> described. I see a section
> for "Search paths", where directories for headers,
> frameworks, libraries,
> and java classes can be entered.If I try placing
> ../Frameworks in the box
> for Frameworks, I get an error that the Framework
> cannot be found
> when I try building. I thought this box  was to tell
> the system where
> to locate things on your system.

It is. This box tells the compiler where to find _your_ private  
framework directory. Since you placed SDL.framework into  
/Library/Frameworks, which is the standard location, you shouldn't have  
any problem with this, anyway. What you really want is to tell the  
compiler to _link_ with the framework. Either drag the framework in way  
down, under "Frameworks & Libraries", or select "Add Frameworks…" from  
the "Project" menu. A third way would be to specify "-framework SDL" in  
the linker settings.
Note that all this still doesn't change your _header_ search path: if  
you do #include "SDL.h", you'll have to add  
"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL.framework/Versions/A/Headers" to  
your header search paths. #include'ing "SDL/SDL.h" should work fine,  
though I haven't verified this.
  The resulting app first searches for the framework in your .app bundle  
(under "Frameworks", "PrivateFrameworks" and "SharedFrameworks", just  
as documented in the link from my last mail), and if it's not there, in  
/Library/Frameworks, /Users/yourusername/Library/Frameworks and  
/System/Library/Frameworks.
To have Project Builder automatically copy the Framework to your .app  
bundle, add a new "Copy files" build phase ("Project/New Build  
Phase/New copy files build phase"). You seem to have an active  
selection in the "Build Phases" list GUI to do this. Under "Where"  
select "Frameworks", no subpath; drag the framework bundle into the box  
down there.

> (snip)

> And is there a way to bundle Frameworks within
> frameworks? I would like to build
> a framework (library) that uses SDL and lots of other
> libs.

I guess not. This would, of course, also defeat the whole purpose of  
this exercise: to still be able to easily exchange (e.g.) the  
SDL.framework with a newer version, on a per-app basis, if needed.
If you really want to do this, you could look into "Umbrella  
frameworks".
/Developer/Documentation/Essentials/SystemOverview/Umbrella/ 
_Umbrella_Frameworks.html

HTH, and sorry to Sam, who has to approve of all my mails, because my  
"From" header is getting garbled by the mail server :-(

Johannes Fortmann





More information about the SDL mailing list