Hi Robert, Jeremy,
Robert I've changed your proposed cmake commandos to detect the osg version. I have attached a file with a macro which can be used to detect everything what osg offers. The main difference to your suggestion is, that it uses EXECUTE_PROCESS instead of EXEC_PROGRAM, which seems to be depricated, I think. Also if no osgversion executable could be found, then the default osgPlugins directory is used. Take a look. Jeremy, you could try this with your library too ;-) Best regards, Art --- Robert Osfield <[EMAIL PROTECTED]> schrieb: > H Jeremy, > > On Wed, May 7, 2008 at 10:19 PM, Jeremy Moles > <[EMAIL PROTECTED]> wrote: > > One question: you manage to determine the > osgPlugins- directory properly > > with your CMake configuration. How do you do this > so I can put it in > > osgWidget? :) > > You can set the OSG version by just running > osgversion from within the > CMake scripts to > acquire the version numbers. The following is what > I added to a > recent OSG based project > that I put together. I'll provide links to the this > later in the > week. The script is: > > EXEC_PROGRAM(osgversion ARGS --major-number > OUTPUT_VARIABLE > OPENSCENEGRAPH_MAJOR_VERSION) > EXEC_PROGRAM(osgversion ARGS --minor-number > OUTPUT_VARIABLE > OPENSCENEGRAPH_MINOR_VERSION) > EXEC_PROGRAM(osgversion ARGS --patch-number > OUTPUT_VARIABLE > OPENSCENEGRAPH_PATCH_VERSION) > EXEC_PROGRAM(osgversion ARGS --so-number > OUTPUT_VARIABLE > OPENSCENEGRAPH_SOVERSION) > > > SET(OPENSCENEGRAPH_MAJOR_VERSION > "${OPENSCENEGRAPH_MAJOR_VERSION}" > CACHE STRING "OpenSceneGraph major version number") > SET(OPENSCENEGRAPH_MINOR_VERSION > "${OPENSCENEGRAPH_MINOR_VERSION}" > CACHE STRING "OpenSceneGraph minor version number") > SET(OPENSCENEGRAPH_PATCH_VERSION > "${OPENSCENEGRAPH_PATCH_VERSION}" > CACHE STRING "OpenSceneGraph patch version number") > SET(OPENSCENEGRAPH_SOVERSION > "${OPENSCENEGRAPH_SOVERSION}" CACHE > STRING "OpenSceneGraph so version number") > SET(OPENSCENEGRAPH_VERSION > ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}) > > > OPTION(APPEND_OPENSCENEGRAPH_VERSION "Append the OSG > version number to > the osgPlugins directory" ON) > IF (APPEND_OPENSCENEGRAPH_VERSION) > SET(OSG_PLUGINS > osgPlugins-${OPENSCENEGRAPH_VERSION}) > ELSE(APPEND_OPENSCENEGRAPH_VERSION) > SET(OSG_PLUGINS osgPlugins) > ENDIF(APPEND_OPENSCENEGRAPH_VERSION) > > # Automatically detected build options > EXEC_PROGRAM(osgversion ARGS Matrix::value_type > OUTPUT_VARIABLE > OSG_USE_FLOAT_MATRIX) > IF(OSG_USE_FLOAT_MATRIX MATCHES "float") > ADD_DEFINITIONS(-DOSG_USE_FLOAT_MATRIX) > ENDIF(OSG_USE_FLOAT_MATRIX MATCHES "float") > > EXEC_PROGRAM(osgversion ARGS Plane::value_type > OUTPUT_VARIABLE > OSG_USE_FLOAT_PLANE) > IF(OSG_USE_FLOAT_PLANE MATCHES "float") > ADD_DEFINITIONS(-DOSG_USE_FLOAT_PLANE) > ENDIF(OSG_USE_FLOAT_PLANE MATCHES "float") > > EXEC_PROGRAM(osgversion ARGS > BoundingSphere::value_type > OUTPUT_VARIABLE OSG_USE_FLOAT_BOUNDINGSPHERE) > IF(OSG_USE_FLOAT_BOUNDINGSPHERE MATCHES "double") > ADD_DEFINITIONS(-DOSG_USE_DOUBLE_BOUNDINGSPHERE) > ENDIF(OSG_USE_FLOAT_BOUNDINGSPHERE MATCHES "double") > > EXEC_PROGRAM(osgversion ARGS BoundingBox::value_type > OUTPUT_VARIABLE > OSG_USE_FLOAT_BOUNDINGBOX) > IF(OSG_USE_FLOAT_BOUNDINGBOX MATCHES "double") > ADD_DEFINITIONS(-DOSG_USE_DOUBLE_BOUNDINGBOX) > ENDIF(OSG_USE_FLOAT_BOUNDINGBOX MATCHES "double") > > > > > (Also, just to show how great OSG is, I added a > quick and dirty hack to > > your viewer example to make it use osgWidget; of > course, it worked like > > a charm. Screenshot attached!) > > Ah it's nice to see orthogonal NodeKits all playing > nice, show you > guys have both be doing things cleanly ;-) > > Robert. > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > Lesen Sie Ihre E-Mails jetzt einfach von unterwegs. www.yahoo.de/go
detectosg.cmake
Description: 4036954579-detectosg.cmake
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org