Hello Patrick,

Patrick Hartling wrote:
> I have run into some problems with trying to use osg2-config to get command 
> line options for the linker on Linux, Windows, and Mac OS X. I already fixed 
> one simple issue (see r1767), but there are more complicated problems 
> lingering. First, in the Windows case, dependency libraries such as libpng 
> or libtiff are written into the generated osg2-config in a way that produces 
> incorrect output when using the --libs or --llibs options. While the OpenSG 
> library names are written out to osg2-config without the .lib extension, the 
> dependency library names are written into the script with the .lib 
> extension. When building the linker output, the script adds the .lib 
> extension to everything. This could be fixed by doing some extra work in 
> osg2-config, but it seems better to me to keep osg2-config simple and fix up 
> the process for generating it.

agreed, the information passed to osg2-config should be fixed for this.

> On Linux, the .so extension is correctly stripped from dependency libraries 
> as long as the named shared library actually ends with .so. If it ends with 
> something else (such as .so.2.1 in the case of libcollada14dom), then the 
> --libs output is invalid for what the GNU linker expects. This isn't 
> necessarily a problem with the script since the CMake user can--and probably 
> should--specify the name of the library with the .so extension.

yes, at least in the majority of cases I would think that is the case.

> I don't know 
> if it is possible for CMake to issue an error or a warning when the user 
> provides input for a library name that will result in invalid output from 
> osg2-config later, but doing so would avoid some hassle for users of 
> osg2-config.

rejecting something that a knowledgeable user might want to use just to 
ensure osg2-config produces sane output does not sound right to me.
I'm wondering if we should specify libs the way cmake normally does, a 
full path to the lib and not use -L/-l at all?

> On Mac OS X, the .dylib extension is not stripped correctly. It is instead 
> truncated to .dy, an outcome that doesn't make much sense to me.

most likely something that attempts to strip .lib triggers here, but as 
you said it does not make sense ;)

> That may 
> just be the result of my lack of familiarity with CMake, however. The bigger 
> problem on Mac OS X concerns the use of frameworks.  The process for
> generating osg2-config is not handling this at all AFAICT.

yes, I apologize to the OS X crowd, but I'm really not familiar with the 
specific concepts of that system and would appreciate help in restoring 
proper support.

> Tweaking 
> osg2-config after it is generated is non-trivial since the expectation from 
> the script is that all library names on Mac OS X can be prefixed with -l in 
> the linker output. The same problem exists for framework paths, a case that 
> requires -F instead of -L.

I guess frameworks need to be handled explicitly then in the build 
system in a similar fashion to libraries and be passed to osg2-config so 
that it can use the information correctly.

> Does anyone have some tips for me on how I might go about fixing up 
> osg2-config and its generation process? I can and will take care of this 
> myself, but I could use a clue or two about how the procedure for generating 
> osg2-config from CMake was devised. There may already be examples available 
> for handling these cases, and I just need some ideas to make good searches.

osg2-config is produced from a total of 3 files, two of which are static 
and live in CMake/osg2-config.part1.in CMake/osg2-config.part3.in. The 
middle part is generated during the build with build specific 
information and at the end all three parts are concatenated to the final 
file.
The middle part is written from 
CMake/BuildFunctions.cmake:OSG_STORE_PROJECT_DEPENDENCIES by writing a 
bunch of variables (lists actually to ${${PROJECT_NAME}_CONFIG_FILE, 
which really is the same for every (sub)project).
In general I would recommend introducing additional variables of the form:
${PROJECT_NAME}_DEP_FRW
${PROJECT_NAME}_DEP_TEST_FRW

just like there are for libs and write those to the middle part of 
osg2-config.
Thanks for willing to look into this, please let me know if I can 
provide more info on how these thinks work/should work ;)

        Cheers,
                Carsten


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to