Hi Philip,

It's good to see Cmake support for OpenSceneGraph being improved.  I
see it's moved on quite a bit from my own little experiments with
FindOSG.cmake for VirtualPlanetBuilder + Present3D.

I've just reviewed the new OSG related Cmake files in CMake CVS and
it's enough different that I can't assess whether or not something
that I addressed recently in the P3D FindOSG.cmake (back ported to
OpenSceneGraph/CMakeModules/FindOSG.cmake) is also addressed.  So
perhaps you can clarify this for me.

The problem that I addressed was thatthat CMake was search system
directories for the OSG headers and libs prior to searching the OSGDIR
env vars, this meant that if an older OSG version was already
installed but a a different version was compiled locally and pointed
at by the OSGDIR the installed version would always be found.  To fix
this I had to split the FIND* calls in such as a way that the OSGDIR
path was checked in one FIND* call, then the system directories were
called afterwards in their of FIND* call.

In the CMake CVS version of FindOpenSceneGraph is it still possible to
override the system paths or explicitly use a local version of the
OSG?

Robert.

On Sat, Jan 31, 2009 at 2:20 AM, Philip Lowman <phi...@yhbt.com> wrote:
> On Thu, Jan 29, 2009 at 10:39 AM, Luigi Calori <l.cal...@cineca.it> wrote:
>>
>> This is my FindOSG file I use for getting dll to copy , it get the version
>> also... see
>>   #get version numbers
>>   EXEC_PROGRAM(${OSG_VERSION_APP} ARGS  --version-number OUTPUT_VARIABLE
>> OSG_VERSION_NUMBER)
>>   EXEC_PROGRAM(${OSG_VERSION_APP} ARGS  --so-number OUTPUT_VARIABLE
>> OSG_SO_NUMBER)
>>     EXEC_PROGRAM(${OSG_VERSION_APP} ARGS  --openthreads-soversion-number
>> OUTPUT_VARIABLE OSG_OT_SO_NUMBER)
>>
>> I agree the FindOSG should be distributed along OSG.
>> My version need to find .dll under windows to copy them into a packaged
>> distribution (Firefox plugin)
>> I use it under Windows and Linux not tested on Mac
>
> A lot of work has been done recently in CVS CMake to improve the Find
> modules shipped with CMake (originally written by Eric Wing) to better work
> with the OSG.  I believe most of the features Luigi has added to his
> FindOSG.cmake should be present there with a couple of improvements:
>
> 1. Component support
> 2. It should be trivial to add find modules for new nodekits (bundled with
> OSG or not) without modifying the core FindOpenSceneGraph.cmake file
> 3. Version support and enforcement (by header file parsing)
> 4. Backwards compatibility with older versions of OSG that lack newer node
> kits.  It will not search for nodekits until told to do so.
>
> I left out exposing the SO version figuring that users that need this level
> of detail can just include osg/Version (or osg/Config in the case of
> double/float issues) and write their own configure tests.  Also SO
> versioning isn't available on all versions of the OSG anyways.
>
> Here's a brief synopsis of how to use it.  As you can see, it is very easy
> for the end user.  It should work anywhere from 2.0.0 to 2.7.9 and might
> even work with 1.2.0 although I don't have binaries around to test this. =)
> Please see the documentation for more details.
>
> ====
> find_package(OpenSceneGraph 2.0.0 REQUIRED osgDB osgGA osgViewer osgUtil)
> include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
> add_executable(foo foo.cc)
> target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
> ====
>
> If you feel anything is missing or if you try it and it doesn't work please
> file a bug in the CMake bug tracker.  I and others in the CMake community
> will support these modules with your patches (especially now that I have
> commit access =) ).  All of the above should be included in the upcoming
> CMake 2.6.3 release.  If you prefer not to muck with CVS I will post when an
> RC that includes the modules is available.
>
> One minor downside to it is that if you can't set
> cmake_minimum_required(VERSION 2.6.3) for your project, you'll have to
> include more than one file in your CMAKE_MODULE_PATH.  This is also a bit of
> a good thing, however, as developers should be able to simply distribute a 5
> line FindosgFoo.cmake for their new nodekits and there will be no need to
> continuously patch a FindOpenSceneGraph.cmake over the long term as it will
> be distributed with CMake.  Also if your project doesn't need the osgFoo
> nodekit you would never need to download the FindosgFoo.cmake file.
>
> http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/?root=CMake
> See:
> FindOpenSceneGraph.cmake
> Findosg_functions.cmake
> Findosg.cmake  (depends on Findosg_functions.cmake)
> FindosgDB.cmake (depends on Findosg_functions.cmake)
> Findosg*.cmake (depends on Findosg_functions.cmake)
> FindOpenThreads.cmake
>
>
> --
> Philip Lowman
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to