Hi Alberto,
Alberto Luaces wrote:
El Miércoles 21 Enero 2009ES 16:08:41 Paul Melis escribió:
It seems that so far OSG hasn't really
supported installing different versions side-by-side (i.e. headers not
put in a directory like include/osg-2.6/...). And even though a
pkgconfig script is distributed these days it doesn't know anything
about versions.
I'd prefer not to tag the header files because then you'd have to modify your
source code when using different versions (osg-2.6, osg-2.7, osgDB-2.6,
osgDB-2.7, and so on...) I think it's preferable to install *development*
libraries on different locations. Then you can easily select which one do you
want to use modifying less paramenters.
What you describe is not exactly what I mean. For example, VTK (made by
Kitware, who also made CMake) uses the following layout
..../include/vtk-5.2
<include files go here>
..../lib/vtk-5.2
<libs go here>
You then specify to your compiler that you want the path
"include/vtk-5.2" to be added to the search path, and in your c++ source
you can still write
#include "vtkBlah.h"
For OSG the equivalent layout would be
<osg-root>/include/osg-2.8
osg/
AlphaFunc
....
osgDB/
ReadFile
....
<osg-root>/lib/osg-2.8
libosg....
By specifying -I<osg-root>/include/osg-2.8 -L<osg-root>/lib/osg-2.8 to,
for example, gcc will make it find the correct headers, while you can
still write
#include <osg/Alpha>
....
in your code. Compiling your sources against a different OSG version
would then use -I<osg-root>/include/osg-2.10 -L<osg-root>/lib/osg-2.10
For example, my system has version 2.4.0, but I usually compile also the SVN
version in my home directory. When I want to link against the SVN version, I
point PKG_CONFIG_PATH to my SVN installation directory, so the compilation
goes against the new version without altering the code neither the build
system.
And thereby you completely ignore a useful feature of pkg-config: it can
give you paths for different installed versions. If you would have, for
example, OSG 2.6.1 installed in ~/osg-2.6 and occassionaly compile the
SVN version and install it to ~/osg-svn then each could have an
openscenegraph.pc file in their lib/pkgconfig directory, but with
differing contents. By specifying both ~/osg-2.6/lib/pkgconfig and
~/osg-svn/lib/pkgconfig in PKG_CONFIG_PATH you can use "g++ -c ...
`pkg-config --exact-version=2.6` --cflags --libs`", or specify a
different version when you want. The version value passed would then
have to be controlled by the build system (easy with, for example,
scons). But I can see that without build system support for easily
changing what OSG version you want to compile against this would be
annoying.
Howewer once the software is built, of course all versions can coexist on the
same directory, at least on Linux :)
No they can't, as the include dirs of different minor versions (e.g. 2.6
versus 2.8) are not guarded by a version number. Libraries and plugins
are safe, though.
Regards,
Paul
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org