<div dir="ltr">On Fri, Jul 18, 2008 at 5:35 PM, Mike Weiblen <<a href="mailto:mike.weiblen@gmail.com">mike.weiblen@gmail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Intending to finally get osgToy and osgVRPN building again with modern<br>
OSG via CMake.<br>
<br>
I've looked at several other independent nodekits/apps for guidance<br>
(osggis, mpv, osgppu, vpb, etc) and they all have separate<br>
CMakeModules directories and use slightly different versions of<br>
FindOSG.cmake, apparently derived from a single ancestor version in<br>
OSG itself (which is the oldest)<br>
<br>
Is there a single definitive package of CMake goodies (including<br>
FindOSG.cmake) for uniformly but compatibly building independent (or<br>
interdependent) nodekits against OSG? I'm hoping there are some<br>
resources to jumpstart that integration, else I may need to punt and<br>
just create hardcoded VS projects for shortterm results.</blockquote><div><br>Mike,<br><br>I've submitted a patch to improve the OSG modules released as part of CMake 2.6.x. It's sitting[1] in the CMake bugtracker, presently unassigned. You could download[2] the latest RC for the upcoming CMake 2.6.1 (or just wait for it to be released, which should be any day now) and use the modules from the patch and they should work fairly well for you in terms of detecting the OSG nodekits and linking against them. The modules won't work with CMake 2.6.0 due to the use of a new feature of find_library called HINTS.<br>
<br>[1] <a href="http://public.kitware.com/Bug/view.php?id=7331">http://public.kitware.com/Bug/view.php?id=7331</a><br>[2] <a href="http://www.cmake.org/files/v2.6/">http://www.cmake.org/files/v2.6/</a><br><br>The patch facilitates external use of the OSG from MSVC/Win32 which is something the official OSG CMake modules don't support directly because they don't have detection of DEBUG libraries of the OSG.<br>
<br>The modules work a little differently from the all-inclusive FindOpenSceneGraph.cmake that's been floating around in that you must call FIND_PACKAGE() for both the OSG and any nodekits you're planning on using. Depending on how many nodekits your project needs this might be a few extra calls to FIND_PACKAGE() but for projects that don't need every library released with the OSG being able to include them separately keeps the CMake cache less cluttered.<br>
<br>find_package(osg) yields...<br>OSG_INCLUDE_DIR<br>
OSG_LIBRARY<br>OSG_LIBRARY_DEBUG<br><br>find_package(osgDB) yields...<br>OSGDB_INCLUDE_DIR<br>OSGDB_LIBRARY<br>OSGDB_LIBRARY_DEBUG<br><br>etc.<br><br></div></div>On platforms other than MSVC the _LIBRARY_DEBUG variable is simply set to the contents of the _LIBRARY which allows for a relatively simple<br>
target_link_libraries(foo optimized ${OSG_LIBRARY} debug ${OSG_LIBRARY_DEBUG}) that will work for all platforms.<br><br>I have updated the patch to support osgWidget as well. If anyone has any additional suggestions to improve the modules, I'm all ears.<br>
<br>-- <br>Philip Lowman
</div>