Discussion:
Building the SVG plugin
Paul Martz
2008-05-13 00:43:45 UTC
Permalink
I just updated OSG and would like to take the new SVG plugin for a test
drive. Unfortunately, CMake doesn't appear to find the librsvg/cairo
dependencies, and consequently, building OSG does not build the SVG plugin.
The real odd part is that I don't see any CMake variables for controlling
where CMake searches for librsvg/cairo.I'm trying this on Windows, but that
shouldn't make a difference for CMake...

Advice?

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com <http://www.skew-matrix.com/>
+1 303 859 9466
Jean-Sébastien Guay
2008-05-13 01:52:13 UTC
Permalink
Hi Paul,
Post by Paul Martz
The real odd part is that I don't see any CMake variables for
controlling where CMake searches for librsvg/cairo.I'm trying this on
Windows, but that shouldn't make a difference for CMake...
If I read the traffic on the SVG plugin right, the submitter only tested
on Linux, where CMake can just look for the headers in a standard place
or use pkgconfig to find them. On Windows we don't have that luxury, and
even though CMake is cross-platform, it's up to the submitter to add
variables to be able to manually specify where the headers and libs are.

I imagine this will be resolved in a few days, or you can always try to
do it yourself. CMake files are pretty self-explanatory. It's probably
just exposing the variable that's used on Linux as a user-modifiable
setting.

J-S
--
______________________________________________________
Jean-Sebastien Guay jean-sebastien.guay-***@public.gmane.org
http://www.cm-labs.com/
http://whitestar02.webhop.org/
Ulrich Hertlein
2008-05-13 01:52:42 UTC
Permalink
Post by Paul Martz
drive. Unfortunately, CMake doesn't appear to find the librsvg/cairo
dependencies, and consequently, building OSG does not build the SVG
plugin. The real odd part is that I don't see any CMake variables for
controlling where CMake searches for librsvg/cairo.I'm trying this on
Windows, but that shouldn't make a difference for CMake...
The build is controlled from OpenSceneGraph/CMakeLists.txt, look for
PKG_CHECK_MODULES(RSVG...) and CAIRO. This obviously assumes that 'pkg-config'
is installed and I'm not sure if that's the case on Windows.

Apart from that, did you clean your CMakeCache?
/ulrich
Philip Lowman
2008-05-13 04:33:06 UTC
Permalink
Post by Ulrich Hertlein
Post by Paul Martz
drive. Unfortunately, CMake doesn't appear to find the librsvg/cairo
dependencies, and consequently, building OSG does not build the SVG plugin.
The real odd part is that I don't see any CMake variables for controlling
where CMake searches for librsvg/cairo.I'm trying this on Windows, but that
shouldn't make a difference for CMake...
The build is controlled from OpenSceneGraph/CMakeLists.txt, look for
PKG_CHECK_MODULES(RSVG...) and CAIRO. This obviously assumes that
'pkg-config' is installed and I'm not sure if that's the case on Windows.
This is one of those issues where CMake is both a blessing and a curse. The
pkg_check_modules() macro is very nice in that it works out-of-the-box with
any standard ".pc" file, so it's great for when you're using GCC but
pkg-config is pretty rare when using something like Visual Studio in the
Windows world (although I did notice a flag to pkg-config the other day for
Visual Studio, haven't tried it out yet, I doubt that it CMake uses it).

The short of it is if you want true cross-platform support you have to write
a Find module for the libraries you need and make it behave properly on both
Linux and Windows. Usually it pretty much works out-of-the-box on Linux and
on Windows since you can't make it work out-of-the-box in practice you rely
on tools such as the CMAKE_PREFIX_PATH or CMAKE_LIBRARY_PATH to "autodetect"
the dependency. This is exactly what the OSG does. Someone bites the
bullet and builds all the dependencies manually, throws them in a folder and
there y'are.
--
Philip Lowman
Robert Osfield
2008-05-13 08:40:12 UTC
Permalink
Hi Paul,

As JS, Ulrich and Philip has mentioned at present the dependency
checking code relies upon pkg-config, which isn't
standard under Windows. For Windows we'll need write our won
FindCario and FindRSVG.cmake files such as the ones
we already have in OpenSceneGraph/CMakeModules.

Robert.
Post by Paul Martz
I just updated OSG and would like to take the new SVG plugin for a test
drive. Unfortunately, CMake doesn't appear to find the librsvg/cairo
dependencies, and consequently, building OSG does not build the SVG plugin.
The real odd part is that I don't see any CMake variables for controlling
where CMake searches for librsvg/cairo.I'm trying this on Windows, but that
shouldn't make a difference for CMake...
Advice?
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Paul Martz
2008-05-13 15:11:41 UTC
Permalink
Post by Jean-Sébastien Guay
Hi Paul,
As JS, Ulrich and Philip has mentioned at present the
dependency checking code relies upon pkg-config, which isn't
standard under Windows. For Windows we'll need write our won
FindCario and FindRSVG.cmake files such as the ones we
already have in OpenSceneGraph/CMakeModules.
I was not aware that CMake offered multiple mechanisms for locating library
dependencies. I have some questions about this; keep in mind I'm no CMake
guru, so my questions might be stupid ones...

Should OSG have some kind of policy regarding this so that third party
dependencies are all located in a consistent manner? A quick check of the
OSG CMake macros reveals that only GTK and rsvg/cario use the pkg config
method, while all other third party dependencies are located using CMake
Find scripts.

If there is no need for a policy of consistency, then how would someone
determine the appropriate method for locating a dependency? In other words,
suppose I made a OSG code change that required a new third party library;
how would I decide what CMake location method is appropriate?
-Paul
Philip Lowman
2008-05-15 11:42:32 UTC
Permalink
Post by Paul Martz
Post by Jean-Sébastien Guay
Hi Paul,
As JS, Ulrich and Philip has mentioned at present the
dependency checking code relies upon pkg-config, which isn't
standard under Windows. For Windows we'll need write our won
FindCario and FindRSVG.cmake files such as the ones we
already have in OpenSceneGraph/CMakeModules.
I was not aware that CMake offered multiple mechanisms for locating library
dependencies. I have some questions about this; keep in mind I'm no CMake
guru, so my questions might be stupid ones...
Should OSG have some kind of policy regarding this so that third party
dependencies are all located in a consistent manner? A quick check of the
OSG CMake macros reveals that only GTK and rsvg/cario use the pkg config
method, while all other third party dependencies are located using CMake
Find scripts.
Can GTK and rsvg/cairo be built under Visual Studio?

Converting the OSG from using the pkg config macros to a Find module
shouldn't be that much work. Have a look for Find*.cmake files in the OSG
trunk and you'll have a pretty good idea what's involved.

If there is no need for a policy of consistency, then how would someone
Post by Paul Martz
determine the appropriate method for locating a dependency? In other words,
suppose I made a OSG code change that required a new third party library;
how would I decide what CMake location method is appropriate?
I have seen CMake Find modules before that use pkg-config if it is available
and if not fall back on locating the libraries manually using FIND_LIBRARY.
Usually though it's not too much work just to convert everything to calling
FIND_LIBRARY.
--
Philip Lowman
Jason Daly
2008-05-15 15:24:33 UTC
Permalink
Post by Philip Lowman
Can GTK and rsvg/cairo be built under Visual Studio?
They can (I've done it), but it takes a bit of work. The Visual Studio
modes of compiling aren't well-maintained by some of the libraries. The
trickiest one was fontconfig (a dependency of rsvg).

--"J"

Continue reading on narkive:
Search results for 'Building the SVG plugin' (Questions and Answers)
10
replies
advantages of firefox ?
started 2007-03-29 08:37:50 UTC
laptops & notebooks
Loading...