mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] [PATCH] Add OpenSceneGraph


From: Martin Lambers
Subject: Re: [Mingw-cross-env-list] [PATCH] Add OpenSceneGraph
Date: Sun, 17 Jan 2010 19:39:02 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Thu, 14. Jan 2010, 00:29:11 +0100, Volker Grabsch wrote:
> > All of the information about external libraries and the subset of
> > plugins that get build is available in CMAKE, but unfortunately I cannot
> > find a way to extract it and write it into the .pc files.
> > 
> > For mingw-cross-env, I see three options:
> > 
> > 1) Find a CMAKE wizard who solves the problems listed above and proposes
> >    a patch to upstream.
> 
> Could you file a bug report to OSG, using your excellent description
> you wrote in this email?
> 
> I guess the OSG people have more expertise in CMAKE than we have.

I will, once we have agreed on a solution, so that there's a real use
case to point to.

> > 2) Build pkg-config files (either a single file or multiple files) that
> >    provide the correct information for mingw-cross-env. This would need
> >    tweaking for every new OSG release, and also when additional packages in
> >    mingw-cross-env enable additional OSG plugins (for example, dcmtk for
> >    the DICOM plugin).
> > 3) Accept that OSG currently does not support static linking hints with
> >    pkg-config, and require applications to do their static linking
> >    themselves.
> 
> I see no advantage of 3) compared to 2), because in option 3) you also
> have to keep a list of linker options. The only difference is that in 3)
> it's informal (part of the docs) and in 2) it's explicit. So I think
> that 2) is superior to 3) in any regard.

I attached a new revision of the OpenSceneGraph patch, with the
following differences:

- The patch is for mingw-cross-env HEAD, not 2.10.
- It provides modular .pc files, like Debian/testing provides for OSG
  2.8.x, and like upstream will provide for future stable OSG releases.
  The .pc files contain the necessary information for static linking,
  and there is an additional file openscenegraph-osgPlugins.pc which
  contains the necessary ifnormation about plugins, but only for static
  linking. This means "i686-pc-mingw32-pkg-config --static --libs
  openscenegraph-osgViewer openscenegraph-osgPlugins" is now sufficient
  to link the osgstaticviewer example.
  The information is hardcoded for mingw-cross-env and does not use any
  $(SED) magic, which means that the file will have to be updated with
  new releases.
- The documentation is in doc/index.html.
- The static OpenEXR plugin is patched (it hardcoded a dependency on DLL
  behaviour).
- The PNG plugin has been disabled because it does not compile with
  libpng-1.4.0 in mingw-cross-env HEAD. I'm sure this will be fixed soon
  upstream so that we can apply a patch and reenable it.

With this version, I can add a ton of file format plugins to
osgstaticviewer.cpp via USE_OSGPLUGIN(), and then compile with

i686-pc-mingw32-g++ -DOSG_LIBRARY_STATIC                                        
                \
-o osgstaticviewer.exe examples/osgstaticviewer/osgstaticviewer.cpp             
                \
`i686-pc-mingw32-pkg-config --cflags openscenegraph-osgViewer 
openscenegraph-osgPlugins`        \
`i686-pc-mingw32-pkg-config --static --libs openscenegraph-osgViewer 
openscenegraph-osgPlugins`

The result is a single large binary that should be able to display almost
anything (I tried a few image file formats).

If this version is ok, I will propose the .pc changes to upstream and
hope they know how to generate the files properly with cmake, so that we
can drop openscenegraph-pkg-config.patch for future releases.

Martin

Attachment: osg.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]