Unified the setup of version numbers so that they all are based on the version

number setup in the include/osg/Version header file.
This commit is contained in:
Robert Osfield
2007-04-22 20:19:43 +00:00
parent 4248c0f8c8
commit f242570269
12 changed files with 169 additions and 12 deletions

View File

@@ -11,10 +11,42 @@
* OpenSceneGraph Public License for more details.
*/
#include <osg/Version>
#include <string>
extern "C" {
const char* osgGetVersion()
{
return "1.9";
static char osg_version[256];
static int osg_version_init = 1;
if (osg_version_init)
{
if (OSG_VERSION_RELEASE==0)
{
if (OSG_VERSION_REVISION==0)
{
sprintf(osg_version,"%d.%d",OSG_VERSION_MAJOR,OSG_VERSION_MINOR);
}
else
{
sprintf(osg_version,"%d.%d-%d",OSG_VERSION_MAJOR,OSG_VERSION_MINOR,OSG_VERSION_REVISION);
}
}
else
{
if (OSG_VERSION_REVISION==0)
{
sprintf(osg_version,"%d.%d.%d",OSG_VERSION_MAJOR,OSG_VERSION_MINOR,OSG_VERSION_RELEASE);
}
else
{
sprintf(osg_version,"%d.%d.%d-%d",OSG_VERSION_MAJOR,OSG_VERSION_MINOR,OSG_VERSION_RELEASE,OSG_VERSION_REVISION);
}
}
osg_version_init = 0;
}
return osg_version;
}
@@ -22,3 +54,5 @@ const char* osgGetLibraryName()
{
return "OpenSceneGraph Library";
}
}