osgEarth 2.1.1
Functions

/home/cube/sources/osgearth/src/osgEarth/Version.cpp File Reference

#include <osgEarth/Common>
#include <osgEarth/Version>
#include <string>
#include <stdio.h>
Include dependency graph for Version.cpp:

Go to the source code of this file.

Functions

const char * osgEarthGetVersion ()
const char * osgEarthGetSOVersion ()
const char * osgEarthGetLibraryName ()

Function Documentation

const char* osgEarthGetLibraryName ( )

The osgGetLibraryName() method returns the library name in human-friendly form.

Definition at line 61 of file Version.cpp.

{
    return "osgEarth Library";
}

Here is the caller graph for this function:

const char* osgEarthGetSOVersion ( )

The osgGetSOVersion() method returns the OSGEARTH shared object version number.

Definition at line 48 of file Version.cpp.

{
    static char osgearth_soversion[32];
    static int osgearth_soversion_init = 1;
    if (osgearth_soversion_init)
    {
        sprintf(osgearth_soversion,"%d",OSGEARTH_SOVERSION);
        osgearth_soversion_init = 0;
    }
    
    return osgearth_soversion;
}

Here is the caller graph for this function:

const char* osgEarthGetVersion ( )

osgEarthGetVersion() returns the library version number. Numbering convention : OSGEARTH-1.0 will return 1.0 from osgEarthGetVersion.

This C function can be also used to check for the existence of the OSGEARTH library using autoconf and its m4 macro AC_CHECK_LIB.

Here is the code to add to your configure.in:

 #
 # Check for the OSGEARTH (OSG) library
 #
 AC_CHECK_LIB(osg, osgEarthGetVersion, ,
    [AC_MSG_ERROR(OSGEARTH library not found. See http://www.osgearth.org)],)
 

Definition at line 27 of file Version.cpp.

{
    static char osgearth_version[256];
    static int osgearth_version_init = 1;
    if (osgearth_version_init)
    {
        if (OSGEARTH_VERSION_REVISION==0)
        {
            sprintf(osgearth_version,"%d.%d.%d",OSGEARTH_MAJOR_VERSION,OSGEARTH_MINOR_VERSION,OSGEARTH_PATCH_VERSION);
        }
        else
        {
            sprintf(osgearth_version,"%d.%d.%d-%d",OSGEARTH_MAJOR_VERSION,OSGEARTH_MINOR_VERSION,OSGEARTH_PATCH_VERSION,OSGEARTH_VERSION_REVISION);
        }

        osgearth_version_init = 0;
    }
    
    return osgearth_version;
}

Here is the caller graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines