diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fde6117a..c7ce60270 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,7 +88,7 @@ if (NOT versionFile) message(FATAL_ERROR "Unable to determine FlightGear version. Version file is missing.") endif() string(STRIP "${versionFile}" FLIGHTGEAR_VERSION) -# add a dependency on the versino file +# add a dependency on the version file set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS version) # FlightGear packaging (to build a source tarball) @@ -110,12 +110,12 @@ if(NOT CMAKE_BUILD_TYPE) endif(NOT CMAKE_BUILD_TYPE) if(NOT "$ENV{BUILD_ID}" STREQUAL "") - set(HUDSON_BUILD_ID $ENV{BUILD_ID}) - set(HUDSON_BUILD_NUMBER $ENV{BUILD_NUMBER}) - message(STATUS "running under Hudson/Jenkins, build-number is ${HUDSON_BUILD_NUMBER}") + set(JENKINS_BUILD_ID $ENV{BUILD_ID}) + set(JENKINS_BUILD_NUMBER $ENV{BUILD_NUMBER}) + message(STATUS "running under Jenkins, build-number is ${JENKINS_BUILD_NUMBER}") else() - set(HUDSON_BUILD_NUMBER 0) - set(HUDSON_BUILD_ID "none") + set(JENKINS_BUILD_NUMBER 0) + set(JENKINS_BUILD_ID "none") endif() ##################################################################################### @@ -558,6 +558,12 @@ configure_file ( "${PROJECT_BINARY_DIR}/src/Include/version.h" ) +# finally the build-id info +configure_file ( + "${PROJECT_SOURCE_DIR}/src/Include/build.h.cmake-in" + "${PROJECT_BINARY_DIR}/src/Include/build.h" +) + add_subdirectory(3rdparty) add_subdirectory(utils) diff --git a/scripts/tools/version.bat b/scripts/tools/version.bat deleted file mode 100644 index 153a6734d..000000000 --- a/scripts/tools/version.bat +++ /dev/null @@ -1,25 +0,0 @@ - -REM - -ECHO OFF - -SET /P FLIGHTGEAR_VERSION= %Header% - -ECHO #define FLIGHTGEAR_VERSION "%FLIGHTGEAR_VERSION%" >> %Header% -ECHO #define HUDSON_BUILD_ID "%HUDSON_BUILD_ID%" >> %Header% -ECHO #define HUDSON_BUILD_NUMBER %HUDSON_BUILD_NUMBER% >> %Header% -ECHO #define REVISION "%REVISION%" >> %Header% - - - diff --git a/src/Include/build.h.cmake-in b/src/Include/build.h.cmake-in new file mode 100644 index 000000000..401355a4e --- /dev/null +++ b/src/Include/build.h.cmake-in @@ -0,0 +1,10 @@ + +#define FLIGHTGEAR_VERSION "@FLIGHTGEAR_VERSION@" + +#define JENKINS_BUILD_NUMBER @JENKINS_BUILD_NUMBER@ +#define JENKINS_BUILD_ID "@JENKINS_BUILD_ID@" +#define REVISION "@REVISION@" + + + + diff --git a/src/Include/version.h.cmake-in b/src/Include/version.h.cmake-in index 140e14009..fa0a0accb 100644 --- a/src/Include/version.h.cmake-in +++ b/src/Include/version.h.cmake-in @@ -1,10 +1,6 @@ #define FLIGHTGEAR_VERSION "@FLIGHTGEAR_VERSION@" -#define HUDSON_BUILD_NUMBER @HUDSON_BUILD_NUMBER@ -#define HUDSON_BUILD_ID "@HUDSON_BUILD_ID@" -#define REVISION "@REVISION@" - diff --git a/src/Main/bootstrap.cxx b/src/Main/bootstrap.cxx index db16c69db..3800498cb 100644 --- a/src/Main/bootstrap.cxx +++ b/src/Main/bootstrap.cxx @@ -20,10 +20,7 @@ // // $Id$ - -#ifdef HAVE_CONFIG_H -# include -#endif +#include #ifdef HAVE_WINDOWS_H #include @@ -62,6 +59,7 @@ #include #include "main.hxx" #include +#include #include
#include
#include
@@ -295,9 +293,9 @@ int main ( int argc, char **argv ) } else { global_crashRptEnabled = true; - crAddProperty("hudson-build-id", HUDSON_BUILD_ID); + crAddProperty("hudson-build-id", JENKINS_BUILD_ID); char buf[16]; - ::snprintf(buf, 16, "%d", HUDSON_BUILD_NUMBER); + ::snprintf(buf, 16, "%d", JENKINS_BUILD_NUMBER); crAddProperty("hudson-build-number", buf); crAddProperty("git-revision", REVISION); crAddProperty("build-type", FG_BUILD_TYPE); diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 40578b8d4..306e7b54e 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -69,6 +69,7 @@ extern bool global_crashRptEnabled; #include #include #include +#include #include "fg_commands.hxx" #include "fg_io.hxx" @@ -493,8 +494,8 @@ int fgMainInit( int argc, char **argv ) SG_LOG( SG_GENERAL, SG_INFO, "FlightGear: Version " << version ); SG_LOG( SG_GENERAL, SG_INFO, "FlightGear: Build Type " << FG_BUILD_TYPE ); SG_LOG( SG_GENERAL, SG_INFO, "Built with " << SG_COMPILER_STR); - SG_LOG( SG_GENERAL, SG_INFO, "Jenkins number/ID " << HUDSON_BUILD_NUMBER << ":" - << HUDSON_BUILD_ID); + SG_LOG( SG_GENERAL, SG_INFO, "Jenkins number/ID " << JENKINS_BUILD_NUMBER << ":" + << JENKINS_BUILD_ID); // seed the random number generator sg_srandom_time(); @@ -512,7 +513,7 @@ int fgMainInit( int argc, char **argv ) bool showLauncher = flightgear::Options::checkForArg(argc, argv, "launcher"); // an Info.plist bundle can't define command line arguments, but it can set // environment variables. This avoids needed a wrapper shell-script on OS-X. - showLauncher |= (::getenv("FG_LAUNCHER") != 0); + showLauncher |= (::getenv("FG_LAUNCHER") != nullptr); if (showLauncher) { // to minimise strange interactions when launcher and config files // set overlaping options, we disable the default files. Users can @@ -624,7 +625,7 @@ int fgMainInit( int argc, char **argv ) // clean up here; ensure we null globals to avoid // confusing the atexit() handler delete globals; - globals = NULL; + globals = nullptr; // delete the NavCache here. This will cause the destruction of many cached // objects (eg, airports, navaids, runways). diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 2f861b0a2..3f8315412 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -83,6 +83,7 @@ #include #include +#include #include using std::string; @@ -244,8 +245,8 @@ void fgSetDefaults () osg::Referenced::getThreadSafeReferenceCounting()); #endif v->setValueReadOnly("revision", REVISION); - v->setValueReadOnly("build-number", HUDSON_BUILD_NUMBER); - v->setValueReadOnly("build-id", HUDSON_BUILD_ID); + v->setValueReadOnly("build-number", JENKINS_BUILD_NUMBER); + v->setValueReadOnly("build-id", JENKINS_BUILD_ID); v->setValueReadOnly("hla-support", bool(FG_HAVE_HLA)); v->setValueReadOnly("build-type", FG_BUILD_TYPE); @@ -2752,7 +2753,7 @@ void Options::showVersion() const { cout << "FlightGear version: " << FLIGHTGEAR_VERSION << endl; cout << "Revision: " << REVISION << endl; - cout << "Build-Id: " << HUDSON_BUILD_ID << endl; + cout << "Build-Id: " << JENKINS_BUILD_ID << endl; cout << "Build-Type: " << FG_BUILD_TYPE << endl; cout << "FG_ROOT=" << globals->get_fg_root().utf8Str() << endl; cout << "FG_HOME=" << globals->get_fg_home().utf8Str() << endl; @@ -2789,7 +2790,7 @@ void Options::printJSONReport() const cJSON_AddItemToObject(rootNode, "general", generalNode); cJSON_AddStringToObject(generalNode, "name", "FlightGear"); cJSON_AddStringToObject(generalNode, "version", FLIGHTGEAR_VERSION); - cJSON_AddStringToObject(generalNode, "build ID", HUDSON_BUILD_ID); + cJSON_AddStringToObject(generalNode, "build ID", JENKINS_BUILD_ID); cJSON_AddStringToObject(generalNode, "build type", FG_BUILD_TYPE); cJSON *configNode = cJSON_CreateObject(); diff --git a/src/Network/flarm.cxx b/src/Network/flarm.cxx index 0b6e634cf..43f172bea 100644 --- a/src/Network/flarm.cxx +++ b/src/Network/flarm.cxx @@ -38,6 +38,7 @@ #include
#include
#include +#include #include "flarm.hxx"