Hi Paul,

When I was removing the MATH_LIBRARY entry from the
src/osgText/CMakeLists.txt  (the one that I had added to see it would
help you) I noticed that FreeType was listed but this isn't needed by
osgText, just by the freetype plugin so I have removed this as it's
not needed and potentially could extra complications that it needn't
have.  Could you try svn/trunk to see if it makes any difference.
I've attached the cleaned up osgText/CMakeLists.txt in case you just
want to try this on its own.

Robert.


On Fri, Dec 19, 2008 at 3:53 PM, Paul Fotheringham <osg_u...@yahoo.co.uk> wrote:
> Hi Robert,
>
> If I set MATH_LIBRARY to "" then it builds fine (with nothing on any on the 
> link lines).
>
> Also, if I set it to /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libm.dylib it 
> also works fine (with /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libm.dylib on 
> each link line).
>
> I must admit I'm puzzled as to why the string associated with MATH_LIBRARY is 
> appearing on the link lines for all the libraries and not just libosg itself 
> as none of the CMakeLists.txt files other than the one in the osg folder 
> refer to it. Are the other libraries somehow inheriting this setting from the 
> cmake settings in libosg?
>
> Paul
>
> --- On Fri, 19/12/08, Robert Osfield <robert.osfi...@gmail.com> wrote:
>
>> From: Robert Osfield <robert.osfi...@gmail.com>
>> Subject: Re: [osg-users] Build error on MAc OSX 10.4 and OSG 2.7.4
>> To: "OpenSceneGraph Users" <osg-users@lists.openscenegraph.org>
>> Date: Friday, 19 December, 2008, 11:15 AM
>> Hi Paul,
>>
>> What happens if, using ccamke, you manually set the
>> MATH_LIBRARY to ""
>> or to your frameworks version?
>>
>> Robert.
>>
>> On Fri, Dec 19, 2008 at 11:06 AM, Paul Fotheringham
>> <osg_u...@yahoo.co.uk> wrote:
>> > --- On Fri, 19/12/08, Robert Osfield
>> <robert.osfi...@gmail.com> wrote:
>> >
>> >> From: Robert Osfield
>> <robert.osfi...@gmail.com>
>> >> Subject: Re: [osg-users] Build error on MAc OSX
>> 10.4 and OSG 2.7.4
>> >> To: osg_u...@yahoo.co.uk, "OpenSceneGraph
>> Users" <osg-users@lists.openscenegraph.org>
>> >> Date: Friday, 19 December, 2008, 8:46 AM
>> >> Hi Paul,
>> >>
>> >> On Thu, Dec 18, 2008 at 6:37 PM, Paul Fotheringham
>> >> <osg_u...@yahoo.co.uk> wrote:
>> >> > Hi Robert,
>> >> >
>> >> > Thanks for looking into this.
>> >> >
>> >> > --- On Thu, 18/12/08, Robert Osfield
>> >> <robert.osfi...@gmail.com> wrote:
>> >> > <snip>
>> >> >> The core OSG library does link against
>> the
>> >> MATH_LIBRARY,
>> >> >> but the other
>> >> >> non of the other core libraries do.
>> >> >
>> >> > Apparently not on MacOSX using cmake :)
>> >>
>> >> Please read what I've already written.
>> I've been
>> >> using Cmake under
>> >> OSX as others have been as well, without problems.
>> >
>> > I've already explained not once, but twice now,
>> why that is.
>> >
>> >> > Take a look at
>> >> >
>> >> > src/osgText/CMakeFiles/osgText.dir/link.txt
>> >> >
>> >> > without the change you just made. In fact
>> take a look
>> >> at any of the link.txt files for each OSG library.
>> Thay all
>> >> have /usr/lib/libm.dylib in there.
>> >> >
>> >> >> I've added a entry of
>> >> >> MATH_LIBRARY into the linking of osgText.
>>  Could
>> >> you do an
>> >> >> svn update
>> >> >> and see if the error is fixed?
>> >> >
>> >> > I got the svn version and no it doesn't
>> fix it.
>> >> All it does is move the
>> >> >
>> >> > /usr/lib/libm.dylib
>> >> >
>> >> > reference on the link line to a different
>> place!
>> >> >
>> >> >> The fact you've got errors but others
>> under
>> >> OSX
>> >> >> haven't reported this
>> >> >> (including myself) suggests that must be
>> something
>> >> else
>> >> >> going w.r.t
>> >> >> gcc/SDK's you are using on your
>> machine.
>> >> >
>> >> > I'm sorry I haven't explained this
>> well
>> >> enough. The goal here is to *not* have any
>> explicit
>> >> reference to libm.dylib on the link line.
>> >> >
>> >> > The symbols reside in the SDK version of the
>> library
>> >> at
>> >> >
>> >> >
>> /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libm.dylib
>> >> >
>> >> > and *not* necessarily at
>> >> >
>> >> > /usr/lib/libm.dylib
>> >> >
>> >> > which is what the MATH_LIBRARY is set to.
>> This is fine
>> >> for UNIX but not Mac as it should be the former
>> that is used
>> >> for a consistent build (if there are Mac
>> developers out
>> >> there who disagree please correct me - I'm new
>> to this).
>> >> >
>> >> > By omitting the explicit reference to
>> libm.dylib the
>> >> Mac build system takes care of this automatically
>> and gets
>> >> the symbols from the SDK version of the library.
>> >> >
>> >> > Users who are not seeing this problem have
>> all the
>> >> symbols they require in /usr/lib/libm.dylib and
>> are, as I
>> >> understand it, lucky ;)
>> >>
>> >> I'll will check what value is used on the OSX
>> box that
>> >> I was remote
>> >> compiling on.
>> >>
>> >> Could you please remove the MATH_LIBRARY entry in
>> the
>> >> src/osg/CMakeLists.txt and
>> src/osgText/CMakeLists.txt to
>> >> test your
>> >> theory about not needing it.
>> >
>> > I agree that only libosg needs it. osgText only needs
>> it indirectly. If I remove the MATH_LIBRARY entry from
>> src/osgText/CMakeLists.txt then /usr/lib/libm.dylib still
>> apears in the link line. To be more precise, it appears in
>> src/osgText/CMakeFiles/osgDB.dir/link.txt which, with my
>> limited knowledge of cmake, is what I assume it uses to
>> perform the link.
>> >
>> > As I implied in my first post, all these references to
>> /usr/lib/libm.dylib on the link lines seem to come from the
>> FIND_LIBRARY(MATH_LIBRARY m) line in the top-level
>> CMakeLists.txt as they all go away if I remove that.
>> >
>> >>
>> >> Robert.
>> >
>> > Paul
>> >
>> >
>> >
>> > _______________________________________________
>> > osg-users mailing list
>> > osg-users@lists.openscenegraph.org
>> >
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> >
>> _______________________________________________
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
IF   (DYNAMIC_OPENSCENEGRAPH)
    ADD_DEFINITIONS(-DOSGTEXT_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
    ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)

SET(LIB_NAME osgText)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})
SET(LIB_PUBLIC_HEADERS
    ${HEADER_PATH}/Export
    ${HEADER_PATH}/Font
    ${HEADER_PATH}/Font3D
    ${HEADER_PATH}/KerningType
    ${HEADER_PATH}/String
    ${HEADER_PATH}/TextBase
    ${HEADER_PATH}/Text
    ${HEADER_PATH}/Text3D
    ${HEADER_PATH}/FadeText
    ${HEADER_PATH}/Version
)

# FIXME: For OS X, need flag for Framework or dylib
ADD_LIBRARY(${LIB_NAME}
    ${OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC}
    ${LIB_PUBLIC_HEADERS}
    DefaultFont.cpp
    DefaultFont.h
    Font.cpp
    Font3D.cpp
    String.cpp
    FadeText.cpp
    TextBase.cpp
    Text.cpp
    Text3D.cpp
    Version.cpp
)

LINK_INTERNAL(${LIB_NAME}     
    osgDB
    osg
    OpenThreads
)
LINK_CORELIB_DEFAULT(${LIB_NAME})

INCLUDE(ModuleInstall OPTIONAL)
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to