Hi Philip: I did not know you has access to the CMake CVS, good to know,.
I had to change my FindOSG as I need to find also .dll and .so on windows and linux. So I needed both version as well soversion, so I decided to run the osgversion utility Furthermore, it seem to me that osgversion provide other flags to check for defines that have been specified in the build process of the osg found. like OSG_USE_FLOAT_MATRIX, OSG_USE_FLOAT_PLANE or OSG_USE_FLOAT_BOUNDINGSPHERE, are those still required to be defined when compiling against osg or they are not used anymore?

I decided to grab VPB version of FindOSG as really do not fully understand the nedd of a separate Findosg<component> . I see that other Find modules that have multiple components such as ImageMagick are implemented as single file. In my opinion, having a single file is more handy if you do not use cvs CMake and also help in keeping the distributed CMake Modules directory cleaned, I think we could just find all the components available in the "standard" place and test the requirements against them.

If some of the macro I use for copying lib and plugins dll could be useful to someone else, let me know, I can try to assemble them better.

Luigi




Philip Lowman ha scritto:
On Thu, Jan 29, 2009 at 10:39 AM, Luigi Calori <l.cal...@cineca.it <mailto: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