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

Reply via email to