[CMake] Re: Mac OS X Framework support

E. Wing ewmailing at gmail.com
Fri Dec 23 18:38:54 EST 2005


> OK, so I guess I could use the glob facility in CMake to find headers inside
> frameworks.  Although, VTK for example does something like this:
>
> #ifdef APPPLE
> #include <OpenGL/Gl.h>
> #else
> #include <Gl/GL.h>
> #endif
>
>
> Seems like if you are going to use a framework, you should use the framework
> structure....
>
> -Bill

These are really two different issues. The first issue is, where to I
get my header file?SDL dictates the usage of "SDL.h" because it is not
guaranteed to be in the same place everywhere. Most Unices put it in
SDL/SDL.h, but FreeBSD puts it in SDL11/SDL.h, and Windows can put it
anywhere like Stuff/SDL.h. The framework really has nothing to do with
this. And the coder shouldn't be expected to case this as there are 
infinite combinations why it gets pushed to the build system.

Frameworks are just a packaging system. They are supposed to be
interchangable with a .dylib. So most times, the coder doesn't know or
care what they're using. This works for most cases, It's just that the
"SDL.h" usage pattern requires everybody (not just OS X Frameworks) to
adjust their default search paths. But it allows for a uniform code
base.

Now for system stuff, like OpenGL which has basically been
standardized, then the #ifdef APPLE approach tends to work better. But
the majority of libraries out there are not standardized. Package
maintainers will put stuff wherever they want, and for OS X, you'll
never know if you're going to be using a dylib or framework.

Thanks,
Eric


More information about the CMake mailing list