Hi Paul,

El Miércoles 21 Enero 2009ES 17:59:03 Paul Melis escribió:
> Hi Alberto,
> > 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
> ....
> 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
>

Now I see that you were referring to bury the headers one level deeper. 
However as you said it would force you to specify the include path even in 
the simplest programs (no more "gcc test.cpp"). This is just a personal 
opinion, though :)

> > 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.

I don't follow you here. If I set PKG_CONFIG_PATH where I installed the svn 
compilation, I still have the system .pc file as a fallback, so I can choose 
which one I want. What do you mean by "without build system"? Pure Makefiles? 
Then you can set the version as a variable and have whichever you want 
without modifying anything on your program... ("make VERSION=2.6.3", 
even "make CXXFLAGS=`pkg-config --exact-version=2.6 --cflags`")

> > 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.

When I said *built* software I meant libraries :) Sorry, I'm always thinking 
of avoiding to put several version sets of include files on system 
directories :)

Regards,

Alberto
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to