From b20d542317529c713871cd75b8426426bbeebf36 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 5 Sep 2007 17:12:24 +0000 Subject: [PATCH] From David Callu, improved consistency of Version strings and add version support for osgIntrospection and osgManipulator. --- include/osgDB/Version | 2 +- include/osgFX/Version | 46 +++++++++++++++++++++++++++ include/osgGA/Version | 4 +-- include/osgIntrospection/Version | 48 +++++++++++++++++++++++++++++ include/osgManipulator/Version | 48 +++++++++++++++++++++++++++++ include/osgParticle/Version | 4 +-- include/osgShadow/Version | 4 +-- include/osgSim/Version | 4 +-- include/osgTerrain/Version | 2 +- include/osgText/Version | 4 +-- include/osgUtil/Version | 4 +-- include/osgViewer/Version | 4 +-- src/osgDB/Version.cpp | 2 +- src/osgFX/CMakeLists.txt | 2 ++ src/osgFX/Version.cpp | 29 +++++++++++++++++ src/osgGA/Version.cpp | 2 +- src/osgIntrospection/CMakeLists.txt | 2 ++ src/osgIntrospection/Version.cpp | 30 ++++++++++++++++++ src/osgManipulator/CMakeLists.txt | 2 ++ src/osgManipulator/Version.cpp | 30 ++++++++++++++++++ src/osgSim/Version.cpp | 2 +- src/osgUtil/Version.cpp | 2 +- src/osgViewer/Version.cpp | 12 ++++++++ 23 files changed, 269 insertions(+), 20 deletions(-) create mode 100644 include/osgFX/Version create mode 100644 include/osgIntrospection/Version create mode 100644 include/osgManipulator/Version create mode 100644 src/osgFX/Version.cpp create mode 100644 src/osgIntrospection/Version.cpp create mode 100644 src/osgManipulator/Version.cpp diff --git a/include/osgDB/Version b/include/osgDB/Version index a698b697d..e6c6bf907 100644 --- a/include/osgDB/Version +++ b/include/osgDB/Version @@ -28,7 +28,7 @@ extern "C" { * Here is the code to add to your configure.in: \verbatim # - # Check for the OpenSceneGraph (OSG) library + # Check for the OpenSceneGraph (OSG) DB library # AC_CHECK_LIB(osg, osgDBGetVersion, , [AC_MSG_ERROR(OpenSceneGraph DB library not found. See http://www.openscenegraph.org)],) diff --git a/include/osgFX/Version b/include/osgFX/Version new file mode 100644 index 000000000..3437cfcfb --- /dev/null +++ b/include/osgFX/Version @@ -0,0 +1,46 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSGFX_VERSION +#define OSGFX_VERSION 1 + +#include + +extern "C" { + +/** + * osgFXGetVersion() returns the library version number. + * Numbering convention : OpenSceneGraph-1.0 will return 1.0 from osgFXGetVersion. + * + * This C function can be also used to check for the existence of the OpenSceneGraph + * library using autoconf and its m4 macro AC_CHECK_LIB. + * + * Here is the code to add to your configure.in: + \verbatim + # + # Check for the OpenSceneGraph (OSG) FX library + # + AC_CHECK_LIB(osg, osgFXGetVersion, , + [AC_MSG_ERROR(OpenSceneGraph FX library not found. See http://www.openscenegraph.org)],) + \endverbatim +*/ +extern OSGFX_EXPORT const char* osgFXGetVersion(); + +/** + * getLibraryName() returns the library name in human friendly form. +*/ +extern OSGFX_EXPORT const char* osgFXGetLibraryName(); + +} + +#endif diff --git a/include/osgGA/Version b/include/osgGA/Version index 41f72d4b7..909b96414 100644 --- a/include/osgGA/Version +++ b/include/osgGA/Version @@ -29,10 +29,10 @@ extern "C" { * Here is the code to add to your configure.in: \verbatim # - # Check for the OpenSceneGraph (OSG) utility library + # Check for the OpenSceneGraph (OSG) GA library # AC_CHECK_LIB(osg, osgGAGetVersion, , - [AC_MSG_ERROR(OpenSceneGraph utility library not found. See http://www.openscenegraph.org)],) + [AC_MSG_ERROR(OpenSceneGraph GA library not found. See http://www.openscenegraph.org)],) \endverbatim */ extern OSGGA_EXPORT const char* osgGAGetVersion(); diff --git a/include/osgIntrospection/Version b/include/osgIntrospection/Version new file mode 100644 index 000000000..a0ba421c2 --- /dev/null +++ b/include/osgIntrospection/Version @@ -0,0 +1,48 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSGINTROSPECTION_VERSION +#define OSGINTROSPECTION_VERSION 1 + +#include + + +extern "C" { + +/** + * osgIntrospectionGetVersion() returns the library version number. + * Numbering convention : OpenSceneGraph-1.0 will return 1.0 from osgIntrospectionGetVersion. + * + * This C function can be also used to check for the existence of the OpenSceneGraph + * library using autoconf and its m4 macro AC_CHECK_LIB. + * + * Here is the code to add to your configure.in: + \verbatim + # + # Check for the OpenSceneGraph (OSG) Introspection library + # + AC_CHECK_LIB(osg, osgIntrospectionGetVersion, , + [AC_MSG_ERROR(OpenSceneGraph Introspection library not found. See http://www.openscenegraph.org)],) + \endverbatim +*/ +extern OSGINTROSPECTION_EXPORT const char* osgIntrospectionGetVersion(); + +/** + * getLibraryName_osgIntrospection() returns the library name in human friendly form. +*/ +extern OSGINTROSPECTION_EXPORT const char* osgIntrospectionGetLibraryName(); + +} + +#endif + diff --git a/include/osgManipulator/Version b/include/osgManipulator/Version new file mode 100644 index 000000000..b25effa2f --- /dev/null +++ b/include/osgManipulator/Version @@ -0,0 +1,48 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSGMANIPULATOR_VERSION +#define OSGMANIPULATOR_VERSION 1 + +#include + + +extern "C" { + +/** + * osgManipulatorGetVersion() returns the library version number. + * Numbering convention : OpenSceneGraph-1.0 will return 1.0 from osgManipulatorGetVersion. + * + * This C function can be also used to check for the existence of the OpenSceneGraph + * library using autoconf and its m4 macro AC_CHECK_LIB. + * + * Here is the code to add to your configure.in: + \verbatim + # + # Check for the OpenSceneGraph (OSG) Manipulator library + # + AC_CHECK_LIB(osg, osgManipulatorGetVersion, , + [AC_MSG_ERROR(OpenSceneGraph Manipulator library not found. See http://www.openscenegraph.org)],) + \endverbatim +*/ +extern OSGMANIPULATOR_EXPORT const char* osgManipulatorGetVersion(); + +/** + * osgManipulatorGetLibraryName() returns the library name in human friendly form. + */ +extern OSGMANIPULATOR_EXPORT const char* osgManipulatorGetLibraryName(); + +} + +#endif + diff --git a/include/osgParticle/Version b/include/osgParticle/Version index 4791a3ce2..5fbe4ccee 100644 --- a/include/osgParticle/Version +++ b/include/osgParticle/Version @@ -29,10 +29,10 @@ extern "C" { * Here is the code to add to your configure.in: \verbatim # - # Check for the OpenSceneGraph Terrain library + # Check for the OpenSceneGraph Particle library # AC_CHECK_LIB(osg, osgParticleGetVersion, , - [AC_MSG_ERROR(OpenSceneGraph Terrain library not found. See http://www.openscenegraph.org)],) + [AC_MSG_ERROR(OpenSceneGraph Particle library not found. See http://www.openscenegraph.org)],) \endverbatim */ OSGPARTICLE_EXPORT const char* osgParticleGetVersion(); diff --git a/include/osgShadow/Version b/include/osgShadow/Version index 89aceafc0..bf39078dc 100644 --- a/include/osgShadow/Version +++ b/include/osgShadow/Version @@ -28,10 +28,10 @@ extern "C" { * Here is the code to add to your configure.in: \verbatim # - # Check for the OpenSceneGraph (OSG) library + # Check for the OpenSceneGraph (OSG) Shadow library # AC_CHECK_LIB(osg, osgShadowGetVersion, , - [AC_MSG_ERROR(OpenSceneGraph library not found. See http://www.openscenegraph.org)],) + [AC_MSG_ERROR(OpenSceneGraph Shadow library not found. See http://www.openscenegraph.org)],) \endverbatim */ extern OSGSHADOW_EXPORT const char* osgShadowGetVersion(); diff --git a/include/osgSim/Version b/include/osgSim/Version index 7ff3bb781..c4ad87252 100644 --- a/include/osgSim/Version +++ b/include/osgSim/Version @@ -28,10 +28,10 @@ extern "C" { * Here is the code to add to your configure.in: \verbatim # - # Check for the OpenSceneGraph-Sim library + # Check for the OpenSceneGraph (OSG) Sim library # AC_CHECK_LIB(osg, osgSimGetVersion, , - [AC_MSG_ERROR(OpenSceneGraph library not found. See http://www.openscenegraph.org)],) + [AC_MSG_ERROR(OpenSceneGraph Sim library not found. See http://www.openscenegraph.org)],) \endverbatim */ extern OSGSIM_EXPORT const char* osgSimGetVersion(); diff --git a/include/osgTerrain/Version b/include/osgTerrain/Version index 164537942..e9a89d71f 100644 --- a/include/osgTerrain/Version +++ b/include/osgTerrain/Version @@ -28,7 +28,7 @@ extern "C" { * Here is the code to add to your configure.in: \verbatim # - # Check for the OpenSceneGraph Terrain library + # Check for the OpenSceneGraph (OSG) Terrain library # AC_CHECK_LIB(osg, osgTerrainGetVersion, , [AC_MSG_ERROR(OpenSceneGraph Terrain library not found. See http://www.openscenegraph.org)],) diff --git a/include/osgText/Version b/include/osgText/Version index a23a23079..02fbcda4a 100644 --- a/include/osgText/Version +++ b/include/osgText/Version @@ -28,10 +28,10 @@ extern "C" { * Here is the code to add to your configure.in: \verbatim # - # Check for the OpenSceneGraph (OSG) library + # Check for the OpenSceneGraph (OSG) Text library # AC_CHECK_LIB(osg, osgTextGetVersion, , - [AC_MSG_ERROR(OpenSceneGraph library not found. See http://www.openscenegraph.org)],) + [AC_MSG_ERROR(OpenSceneGraph Text library not found. See http://www.openscenegraph.org)],) \endverbatim */ extern OSGTEXT_EXPORT const char* osgTextGetVersion(); diff --git a/include/osgUtil/Version b/include/osgUtil/Version index f71ca1fc0..9d924bc0c 100644 --- a/include/osgUtil/Version +++ b/include/osgUtil/Version @@ -29,10 +29,10 @@ extern "C" { * Here is the code to add to your configure.in: \verbatim # - # Check for the OpenSceneGraph (OSG) utility library + # Check for the OpenSceneGraph (OSG) Util library # AC_CHECK_LIB(osg, osgUtilGetVersion, , - [AC_MSG_ERROR(OpenSceneGraph utility library not found. See http://www.openscenegraph.org)],) + [AC_MSG_ERROR(OpenSceneGraph Util library not found. See http://www.openscenegraph.org)],) \endverbatim */ extern OSGUTIL_EXPORT const char* osgUtilGetVersion(); diff --git a/include/osgViewer/Version b/include/osgViewer/Version index 67f898df6..f64dcb81d 100644 --- a/include/osgViewer/Version +++ b/include/osgViewer/Version @@ -29,10 +29,10 @@ extern "C" { * Here is the code to add to your configure.in: \verbatim # - # Check for the OpenSceneGraph (OSG) utility library + # Check for the OpenSceneGraph (OSG) Viewer library # AC_CHECK_LIB(osg, osgViewerGetVersion, , - [AC_MSG_ERROR(OpenSceneGraph utility library not found. See http://www.openscenegraph.org)],) + [AC_MSG_ERROR(OpenSceneGraph Viewer library not found. See http://www.openscenegraph.org)],) \endverbatim */ extern OSGVIEWER_EXPORT const char* osgViewerGetVersion(); diff --git a/src/osgDB/Version.cpp b/src/osgDB/Version.cpp index c07b20d3b..40f291acc 100644 --- a/src/osgDB/Version.cpp +++ b/src/osgDB/Version.cpp @@ -23,7 +23,7 @@ const char* osgDBGetVersion() const char* osgDBGetLibraryName() { - return "OpenSceneGraph DB (data base) Library"; + return "OpenSceneGraph DB (Data Base) Library"; } } diff --git a/src/osgFX/CMakeLists.txt b/src/osgFX/CMakeLists.txt index cdac7d99d..96eed598d 100644 --- a/src/osgFX/CMakeLists.txt +++ b/src/osgFX/CMakeLists.txt @@ -19,6 +19,7 @@ SET(LIB_PUBLIC_HEADERS ${HEADER_PATH}/SpecularHighlights ${HEADER_PATH}/Technique ${HEADER_PATH}/Validator + ${HEADER_PATH}/Version ) # FIXME: For OS X, need flag for Framework or dylib @@ -35,6 +36,7 @@ ADD_LIBRARY(${LIB_NAME} SpecularHighlights.cpp Technique.cpp Validator.cpp + Version.cpp ) LINK_INTERNAL(${LIB_NAME} diff --git a/src/osgFX/Version.cpp b/src/osgFX/Version.cpp new file mode 100644 index 000000000..cc7803bc3 --- /dev/null +++ b/src/osgFX/Version.cpp @@ -0,0 +1,29 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ +#include +#include + +extern "C" { + +const char* osgFXGetVersion() +{ + return osgGetVersion(); +} + + +const char* osgFXGetLibraryName() +{ + return "OpenSceneGraph FX (Special effects) Library"; +} + +} diff --git a/src/osgGA/Version.cpp b/src/osgGA/Version.cpp index 7d8da9acd..33dc8e7da 100644 --- a/src/osgGA/Version.cpp +++ b/src/osgGA/Version.cpp @@ -24,7 +24,7 @@ const char* osgGAGetVersion() const char* osgGAGetLibraryName() { - return "OpenSceneGraph Gui Adapter Library"; + return "OpenSceneGraph GA (Gui Adapter) Library"; } } diff --git a/src/osgIntrospection/CMakeLists.txt b/src/osgIntrospection/CMakeLists.txt index 0eb225f30..95adb6a5d 100644 --- a/src/osgIntrospection/CMakeLists.txt +++ b/src/osgIntrospection/CMakeLists.txt @@ -35,6 +35,7 @@ SET(LIB_PUBLIC_HEADERS ${HEADER_PATH}/type_traits ${HEADER_PATH}/Utility ${HEADER_PATH}/Value + ${HEADER_PATH}/Version ${HEADER_PATH}/variant_cast ) @@ -52,6 +53,7 @@ ADD_LIBRARY(${LIB_NAME} Type.cpp Utility.cpp Value.cpp + Version.cpp ) LINK_INTERNAL(${LIB_NAME} diff --git a/src/osgIntrospection/Version.cpp b/src/osgIntrospection/Version.cpp new file mode 100644 index 000000000..c127b91da --- /dev/null +++ b/src/osgIntrospection/Version.cpp @@ -0,0 +1,30 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#include +#include + +extern "C" { + +const char* osgIntrospectionGetVersion() +{ + return osgGetVersion(); +} + + +const char* osgIntrospectionGetLibraryName() +{ + return "OpenSceneGraph Introspection Library"; +} + +} diff --git a/src/osgManipulator/CMakeLists.txt b/src/osgManipulator/CMakeLists.txt index 5a51d87b6..9f8fba66c 100644 --- a/src/osgManipulator/CMakeLists.txt +++ b/src/osgManipulator/CMakeLists.txt @@ -29,6 +29,7 @@ SET(LIB_PUBLIC_HEADERS ${HEADER_PATH}/Translate2DDragger ${HEADER_PATH}/TranslateAxisDragger ${HEADER_PATH}/TranslatePlaneDragger + ${HEADER_PATH}/Version ) # FIXME: For OS X, need flag for Framework or dylib @@ -55,6 +56,7 @@ ADD_LIBRARY(${LIB_NAME} Translate2DDragger.cpp TranslateAxisDragger.cpp TranslatePlaneDragger.cpp + Version.cpp ) LINK_INTERNAL(${LIB_NAME} diff --git a/src/osgManipulator/Version.cpp b/src/osgManipulator/Version.cpp new file mode 100644 index 000000000..bbbc5fcea --- /dev/null +++ b/src/osgManipulator/Version.cpp @@ -0,0 +1,30 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#include +#include + +extern "C" { + +const char* osgManipulatorGetVersion() +{ + return osgGetVersion(); +} + + +const char* osgManipulatorGetLibraryName() +{ + return "OpenSceneGraph Manipulator Library"; +} + +} diff --git a/src/osgSim/Version.cpp b/src/osgSim/Version.cpp index 3a27ef93f..294090616 100644 --- a/src/osgSim/Version.cpp +++ b/src/osgSim/Version.cpp @@ -24,7 +24,7 @@ const char* osgSimGetVersion() const char* osgSimGetLibraryName() { - return "OpenSceneGraph Visual Simulation Library"; + return "OpenSceneGraph Sim (Visual Simulation) Library"; } } diff --git a/src/osgUtil/Version.cpp b/src/osgUtil/Version.cpp index 3aa670caa..fe13f25f0 100644 --- a/src/osgUtil/Version.cpp +++ b/src/osgUtil/Version.cpp @@ -23,7 +23,7 @@ const char* osgUtilGetVersion() const char* osgUtilGetLibraryName() { - return "OpenSceneGraph Utility Library"; + return "OpenSceneGraph Util (Utility) Library"; } } diff --git a/src/osgViewer/Version.cpp b/src/osgViewer/Version.cpp index 37dc6d9ad..c09176f8f 100644 --- a/src/osgViewer/Version.cpp +++ b/src/osgViewer/Version.cpp @@ -1,3 +1,15 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ #include #include