Changeset 7383

Show
Ignore:
Timestamp:
09/11/07 12:10:43
Author:
robert
Message:

From Mike Wittman and Robert Osfield, added support for SO_VERSION number in
runtime version info. Added checks for OpenThreads? version.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenSceneGraph/trunk/applications/osgversion/osgversion.cpp

    r7279 r7383  
    22#include <osg/ArgumentParser> 
    33#include <osg/ApplicationUsage> 
     4#include <OpenThreads/Version> 
    45 
    56#include <set> 
     
    650651    arguments.getApplicationUsage()->addCommandLineOption("--entries","Print out number of entries into the ChangeLog file for each contributor."); 
    651652    arguments.getApplicationUsage()->addCommandLineOption("--version-number","Print out version number only"); 
     653    arguments.getApplicationUsage()->addCommandLineOption("--soversion-number","Print out shared object version number only"); 
     654    arguments.getApplicationUsage()->addCommandLineOption("--openthreads-version-number","Print out version number for OpenThreads only"); 
     655    arguments.getApplicationUsage()->addCommandLineOption("--openthreads-soversion-number","Print out shared object version number for OpenThreads only"); 
    652656    arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>","Read the ChangeLog to generate an estimated contributors list."); 
    653657 
     
    655659    { 
    656660        std::cout<<osgGetVersion()<<std::endl; 
     661        return 0; 
     662    } 
     663     
     664    if (arguments.read("--soversion-number")) 
     665    { 
     666        std::cout<<osgGetSOVersion()<<std::endl; 
     667        return 0; 
     668    } 
     669     
     670    if (arguments.read("--openthreads-version-number")) 
     671    { 
     672        std::cout<<OpenThreadsGetVersion()<<std::endl; 
     673        return 0; 
     674    } 
     675     
     676    if (arguments.read("--openthreads-soversion-number")) 
     677    { 
     678        std::cout<<OpenThreadsGetSOVersion()<<std::endl; 
    657679        return 0; 
    658680    } 
  • OpenSceneGraph/trunk/include/osg/Version

    r7350 r7383  
    1919extern "C" { 
    2020 
    21 #define OSG_VERSION_MAJOR 2 
    22 #define OSG_VERSION_MINOR 1 
    23 #define OSG_VERSION_PATCH 9 
    2421 
    25 #define OSG_VERSION_RELEASE OSG_VERSION_PATCH 
    26 #define OSG_VERSION_REVISION 0 
     22#define OPENSCENEGRAPH_MAJOR_VERSION 2 
     23#define OPENSCENEGRAPH_MINOR_VERSION 1 
     24#define OPENSCENEGRAPH_PATCH_VERSION 9 
     25#define OPENSCENEGRAPH_SOVERSION 20 
    2726 
    2827/** 
     
    4443extern OSG_EXPORT const char* osgGetVersion(); 
    4544 
     45/** The osgGetSOVersion() method returns the OpenSceneGraph soversion number. */ 
     46extern OSG_EXPORT const char* osgGetSOVersion(); 
     47 
    4648/** The osgGetLibraryName() method returns the library name in human-friendly form. */ 
    4749extern OSG_EXPORT const char* osgGetLibraryName(); 
     50 
     51// old defines for backwards compatibility. 
     52#define OSG_VERSION_MAJOR OPENSCENEGRAPH_MAJOR_VERSION 
     53#define OSG_VERSION_MINOR OPENSCENEGRAPH_MINOR_VERSION 
     54#define OSG_VERSION_PATCH OPENSCENEGRAPH_PATCH_VERSION 
     55 
     56#define OSG_VERSION_RELEASE OSG_VERSION_PATCH 
     57#define OSG_VERSION_REVISION 0 
     58 
    4859 
    4960} 
  • OpenSceneGraph/trunk/src/osg/Version.cpp

    r7170 r7383  
    3838} 
    3939 
     40const char* osgGetSOVersion() 
     41{ 
     42    static char osg_soversion[32]; 
     43    static int osg_soversion_init = 1; 
     44    if (osg_soversion_init) 
     45    { 
     46        sprintf(osg_soversion,"%d",OPENSCENEGRAPH_SOVERSION); 
     47        osg_soversion_init = 0; 
     48    } 
     49     
     50    return osg_soversion; 
     51} 
    4052 
    4153const char* osgGetLibraryName()