1
0
Fork 0

Use updated version.h if available.

Add single fallback header if version.h is missing.
This commit is contained in:
James Turner 2010-11-13 18:58:55 +00:00
parent a6458c2ed6
commit 1dbe833579
4 changed files with 35 additions and 5 deletions

16
src/Include/no_version.h Normal file
View file

@ -0,0 +1,16 @@
#ifndef FG_NO_VERSION_H
#define FG_NO_VERSION_H
// version.h is generated by the build system for official builds of
// FlightGear. To avoid complicating the life of regular developers,
// especially on Windows, we set HAVE_VERSION_H if version.h is generated.
// If that define is not set, we include this file instead, which provides
// placeholder values instead.
#define FLIGHTGEAR_VERSION "development " __DATE__
#define HUDSON_BUILD_NUMBER 0
#define HUDSON_BUILD_ID "none"
#define REVISION "unknown"
#endif

View file

@ -28,7 +28,7 @@
#define FLIGHTGEAR_VERSION "@VERSION@" #define FLIGHTGEAR_VERSION "@VERSION@"
#define HUDSON_BUILD_NUMBER "@HUDSON_BUILD_NUMBER@" #define HUDSON_BUILD_NUMBER @HUDSON_BUILD_NUMBER@
#define HUDSON_BUILD_ID "@HUDSON_BUILD_ID@" #define HUDSON_BUILD_ID "@HUDSON_BUILD_ID@"
#define REVISION "@REVISION@" #define REVISION "@REVISION@"

View file

@ -76,9 +76,13 @@ using std::string;
#include <Airports/runways.hxx> #include <Airports/runways.hxx>
#include <Airports/simple.hxx> #include <Airports/simple.hxx>
#ifndef _MSC_VER
#ifdef HAVE_VERSION_H
# include <Include/version.h> # include <Include/version.h>
#else
# include <Include/no_version.h>
#endif #endif
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include <Main/globals.hxx> #include <Main/globals.hxx>
#include "instrument_mgr.hxx" #include "instrument_mgr.hxx"

View file

@ -64,8 +64,10 @@ using std::cout;
using std::cerr; using std::cerr;
using std::endl; using std::endl;
#ifndef VERSION #ifdef HAVE_VERSION_H
#define VERSION "CVS "__DATE__ # include <Include/version.h>
#else
# include <Include/no_version.h>
#endif #endif
#define NEW_DEFAULT_MODEL_HZ 120 #define NEW_DEFAULT_MODEL_HZ 120
@ -233,6 +235,12 @@ fgSetDefaults ()
fgSetString("/sim/multiplay/txhost", "0"); fgSetString("/sim/multiplay/txhost", "0");
fgSetInt("/sim/multiplay/rxport", 0); fgSetInt("/sim/multiplay/rxport", 0);
fgSetInt("/sim/multiplay/txport", 0); fgSetInt("/sim/multiplay/txport", 0);
fgSetString("/sim/version/flightgear", FLIGHTGEAR_VERSION);
//fgSetString("/sim/version/simgear", FLIGHTGEAR_VERSION);
fgSetString("/sim/version/revision", REVISION);
fgSetInt("/sim/version/build-number", HUDSON_BUILD_NUMBER);
fgSetString("/sim/version/build-id", HUDSON_BUILD_ID);
} }
static bool static bool
@ -1208,7 +1216,9 @@ fgOptParking( const char *arg )
static int static int
fgOptVersion( const char *arg ) fgOptVersion( const char *arg )
{ {
cerr << "FlightGear version: " << VERSION << endl; cerr << "FlightGear version: " << FLIGHTGEAR_VERSION << endl;
cerr << "Revision: " << REVISION << endl;
cerr << "Build-Id: " << HUDSON_BUILD_ID << endl;
cerr << "FG_ROOT=" << globals->get_fg_root() << endl; cerr << "FG_ROOT=" << globals->get_fg_root() << endl;
cerr << "FG_HOME=" << fgGetString("/sim/fg-home") << endl; cerr << "FG_HOME=" << fgGetString("/sim/fg-home") << endl;
cerr << "FG_SCENERY="; cerr << "FG_SCENERY=";