[CMake] Re: Frameworks and FIND_FILE
Bill Hoffman
bill.hoffman at kitware.com
Tue Dec 27 08:20:45 EST 2005
At 08:07 AM 12/27/2005, E. Wing wrote:
>If you want to go this route, I think we can and should be more
>clever/aggressive. Instead of requiring special framework keywords to
>always being used, I think we can infer which version to use and will
>usually be right. This at least gives a OS X a fighting chance of
>working out of the box without the Find*.cmake authors being OS X
>aware.
>
>
>So in the scenario /System/Library/Frameworks/Bar.framework/Headers/Foo.h
>(note I changed the framework name to Bar to give a little more
>distinction, but this still works for Bar=Foo)
>
>If the usage is
>FIND_PATH(FOO Foo.h),
>then use FOO=/System/Library/Frameworks/Bar.framework/Headers and
>-I/System/Library/Frameworks/Bar.framework/Headers
>
>If the usage is FIND_PATH(FOO Bar/Foo.h)
>then use FOO=/System/Library/Frameworks/Bar.framework and -F/System/Library
>
My concern here is what you said in an earlier email. You said that
when you attempted to just use -I for everything, you ended up with build
errors, because there are .h files in packages with unsafe names:
As you said in an earlier email:
>So my original thinking was, "Why not just use -I for everything
>instead and ditch the -F flag". Well it doesn't work for the opposite
>case.
>
>So OpenSceneGraph for example has basically dictated the other
>direction that you must use the form.
>#include <osg/PositionAttitudeTransform>
>#include <osgText/String>
>This is partly due to the enormous number of headers OSG provides, and
>partly done to avoid name collision.
I would rather have cmake not find something, then to find something and
cause a very strange error because some internal file was found. Either
way I think we are stuck with changing the Find*.cmake stuff to support
the Mac in one way or another. So, I would think that the default should
be the correct and intended way of using Frameworks on the Mac, -F and
not -I. It is much easier to track down a can not find include file X.h, than
a strange syntax error caused by including the wrong header file.
-Bill
More information about the CMake
mailing list