diff --git a/CMakeLists.txt b/CMakeLists.txt index e502aa0a6..667421266 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ PROJECT(OpenSceneGraph) SET(OPENSCENEGRAPH_MAJOR_VERSION 2) SET(OPENSCENEGRAPH_MINOR_VERSION 9) SET(OPENSCENEGRAPH_PATCH_VERSION 6) -SET(OPENSCENEGRAPH_SOVERSION 61) +SET(OPENSCENEGRAPH_SOVERSION 62) # set to 0 when not a release candidate, non zero means that any generated # svn tags will be treated as release candidates of given number @@ -312,6 +312,11 @@ OPTION(OSG_CPP_EXCEPTIONS_AVAILABLE "Set to OFF to disable compile of OSG compon SET(OPENSCENEGRAPH_CONFIG_HEADER "${PROJECT_BINARY_DIR}/include/osg/Config") CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/Config.in" "${OPENSCENEGRAPH_CONFIG_HEADER}") + +SET(OPENSCENEGRAPH_VERSION_HEADER "${PROJECT_BINARY_DIR}/include/osg/Version") +CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/Version.in" + "${OPENSCENEGRAPH_VERSION_HEADER}") + # INSTALL_FILES(/include/osg/ FILES "${OPENSCENEGRAPH_CONFIG_HEADER}") diff --git a/include/osg/Version b/include/osg/Version index 838e4cd9a..00c32c57b 100644 --- a/include/osg/Version +++ b/include/osg/Version @@ -1,13 +1,13 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 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 + * 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 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ @@ -18,7 +18,6 @@ extern "C" { - #define OPENSCENEGRAPH_MAJOR_VERSION 2 #define OPENSCENEGRAPH_MINOR_VERSION 9 #define OPENSCENEGRAPH_PATCH_VERSION 6 diff --git a/src/osg/CMakeLists.txt b/src/osg/CMakeLists.txt index a8b4cbe95..794d742d6 100644 --- a/src/osg/CMakeLists.txt +++ b/src/osg/CMakeLists.txt @@ -37,6 +37,7 @@ SET(LIB_PUBLIC_HEADERS ${HEADER_PATH}/BoundsChecking ${HEADER_PATH}/buffered_value ${HEADER_PATH}/BufferObject + ${HEADER_PATH}/Config ${HEADER_PATH}/Camera ${HEADER_PATH}/CameraNode ${HEADER_PATH}/CameraView diff --git a/src/osg/Config.in b/src/osg/Config.in index f1178ff0d..d8df6439f 100644 --- a/src/osg/Config.in +++ b/src/osg/Config.in @@ -1,4 +1,4 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 2008 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 2008-2009 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 diff --git a/src/osg/Version.in b/src/osg/Version.in new file mode 100644 index 000000000..cb3a71d37 --- /dev/null +++ b/src/osg/Version.in @@ -0,0 +1,73 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 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 OSG_VERSION +#define OSG_VERSION 1 + +#include + +extern "C" { + +#define OPENSCENEGRAPH_MAJOR_VERSION @OPENSCENEGRAPH_MAJOR_VERSION@ +#define OPENSCENEGRAPH_MINOR_VERSION @OPENSCENEGRAPH_MINOR_VERSION@ +#define OPENSCENEGRAPH_PATCH_VERSION @OPENSCENEGRAPH_PATCH_VERSION@ +#define OPENSCENEGRAPH_SOVERSION @OPENSCENEGRAPH_SOVERSION@ + +/* convinience macro that can be used to decide whether a feature is present or not i.e. + * #if OSG_MIN_VERSION_REQUIRED(2,9,5) + * your code here + * #endif + */ +#define OSG_MIN_VERSION_REQUIRED(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSION>MAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION>MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION>=PATCH)))) +#define OSG_VERSION_LESS_THAN(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSIONMAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION>MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION>PATCH)))) +#define OSG_VERSION_GREATER_OR_EQUAL(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSION>MAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION>MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION>=PATCH)))) + + +/** + * osgGetVersion() returns the library version number. + * Numbering convention : OpenSceneGraph-1.0 will return 1.0 from osgGetVersion. + * + * 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) library + # + AC_CHECK_LIB(osg, osgGetVersion, , + [AC_MSG_ERROR(OpenSceneGraph library not found. See http://www.openscenegraph.org)],) + \endverbatim +*/ +extern OSG_EXPORT const char* osgGetVersion(); + +/** The osgGetSOVersion() method returns the OpenSceneGraph soversion number. */ +extern OSG_EXPORT const char* osgGetSOVersion(); + +/** The osgGetLibraryName() method returns the library name in human-friendly form. */ +extern OSG_EXPORT const char* osgGetLibraryName(); + +// old defines for backwards compatibility. +#define OSG_VERSION_MAJOR OPENSCENEGRAPH_MAJOR_VERSION +#define OSG_VERSION_MINOR OPENSCENEGRAPH_MINOR_VERSION +#define OSG_VERSION_PATCH OPENSCENEGRAPH_PATCH_VERSION + +#define OSG_VERSION_RELEASE OSG_VERSION_PATCH +#define OSG_VERSION_REVISION 0 + + +} + +#endif