[osg-users] Finding OSG debug libraries

29 views
Skip to first unread message

Daniel Schmid

unread,
Nov 14, 2012, 3:54:31 AM11/14/12
to osg-...@lists.openscenegraph.org

Hi all

 

I use the following lines to find the libraries of osg:

 

SET(OSGLIBRARIES osgDB osgUtil osgGA osgViewer osgText osgSim osgParticle osgShadow osgManipulator)

FIND_PACKAGE(OpenSceneGraph 3.0.1 COMPONENTS ${OSGLIBRARIES} REQUIRED)

 

Now I want to look for debug libraries. I specify the env path to the correct placement of debug compilation, but cmake still tries to find the osgXXX libs instead of osgXXXd libs. My CMAKE_BUILD_TYPE is correctly set to Debug. What do I have to configure in order that the debug libraries (which exist) are found and used?

 

Regards

Daniel

 

Mathias Buhr

unread,
Nov 14, 2012, 4:46:15 AM11/14/12
to OpenSceneGraph Users
Hi Daniel,

a quick look at the cmake modules indicates that these modules already
seem to look for the debug versions. Release versions are stored in a
variables named like ${module}_LIBRARY. If available the corresponding
debug version are stored ${module}_LIBRARY_DEBUG variables. It looks
like there is no list with all debug versions appended.
So, in your case you just need to use these variables in the
target_link_libraries() call.

Regards
Mathias
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Daniel Schmid

unread,
Nov 15, 2012, 4:30:29 AM11/15/12
to osg-...@lists.openscenegraph.org
Thanks for the reply. The problem I had was that I had only a OSG-debug build. The FindPackage funktions can either find release libs or release&debug libs, but if you provide only debug libs (with d postfix), there is no luck, the find will abort.

Finally I had a release and a debug build, but they reside in different directories. So there was the next problem...

I had to analyse the osg find package scripts, and finally I used env OSGDIR for the release path and OSG_ROOT for the debug path.

I hope this post can help somebody save some time ...

My suggestion would actually be that if only debug libs (with d postfix) are provided, that those libs are taken for release and debug applications build....

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=51103#51103

Mathias Buhr

unread,
Nov 15, 2012, 6:39:31 AM11/15/12
to osg-...@lists.openscenegraph.org
> My suggestion would actually be that if only debug libs (with d postfix) are provided, that those libs are taken for release and debug applications build....
>
> ------------------

I think that's simply not possible on Windows. I'm not a windows
developer myself but I think you can't mix release and debug version there.

Regards
Mathias
Reply all
Reply to author
Forward
0 new messages