From 178d1beb80b9e2374db389ddb43d6be36284328f Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 24 Aug 2020 13:29:51 +0100 Subject: [PATCH] Cmake: Remove version.h machinery Merge this file into config.h, this means we can save an include path everywhere. --- CMakeLists.txt | 6 ------ src/Add-ons/AddonManager.cxx | 3 ++- src/GUI/AddonsModel.cxx | 2 +- src/GUI/AircraftItemModel.cxx | 3 ++- src/GUI/InstallSceneryDialog.cxx | 3 ++- src/GUI/LauncherController.cxx | 3 ++- src/GUI/LauncherMainWindow.cxx | 2 -- src/GUI/LocalAircraftCache.cxx | 1 - src/GUI/QmlAircraftInfo.cxx | 3 ++- src/GUI/SetupRootDialog.cxx | 1 - src/Include/config_cmake.h.in | 3 +-- src/Include/version.h.cmake-in | 6 ------ src/Instrumentation/mk_viii.cxx | 5 +---- src/Instrumentation/tcas.cxx | 6 +----- src/Main/bootstrap.cxx | 1 - src/Main/fg_init.cxx | 1 - src/Main/main.cxx | 1 - src/Main/options.cxx | 1 - src/Main/sentryIntegration.cxx | 1 - src/Network/DNSClient.cxx | 3 ++- src/Network/HTTPClient.cxx | 3 ++- src/Network/flarm.cxx | 5 +---- src/Network/http/httpd.cxx | 3 ++- src/Network/igc.cxx | 6 +----- test_suite/dataStore.cxx | 4 ++-- utils/fgcom/fgcom_external.hxx | 1 - 26 files changed, 24 insertions(+), 53 deletions(-) delete mode 100644 src/Include/version.h.cmake-in diff --git a/CMakeLists.txt b/CMakeLists.txt index 71f4c8589..e2432bd2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -467,12 +467,6 @@ configure_file ( "${PROJECT_BINARY_DIR}/src/Include/config.h" ) -#and the same for the version header -configure_file ( - "${PROJECT_SOURCE_DIR}/src/Include/version.h.cmake-in" - "${PROJECT_BINARY_DIR}/src/Include/version.h" -) - # Setup build.h header, each build include( GenerateBuildInfo ) diff --git a/src/Add-ons/AddonManager.cxx b/src/Add-ons/AddonManager.cxx index 2eafb76f7..520a6ae05 100644 --- a/src/Add-ons/AddonManager.cxx +++ b/src/Add-ons/AddonManager.cxx @@ -17,6 +17,8 @@ // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +#include "config.h" + #include #include #include @@ -33,7 +35,6 @@ #include #include -#include #include
#include
diff --git a/src/GUI/AddonsModel.cxx b/src/GUI/AddonsModel.cxx index e65373133..c879184af 100644 --- a/src/GUI/AddonsModel.cxx +++ b/src/GUI/AddonsModel.cxx @@ -18,12 +18,12 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#include "config.h" #include #include #include #include -#include #include "AddonsModel.hxx" #include "Add-ons/AddonMetadataParser.hxx" diff --git a/src/GUI/AircraftItemModel.cxx b/src/GUI/AircraftItemModel.cxx index 96d88fa2a..7ef4335dd 100644 --- a/src/GUI/AircraftItemModel.cxx +++ b/src/GUI/AircraftItemModel.cxx @@ -18,6 +18,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#include "config.h" + #include "AircraftItemModel.hxx" #include @@ -35,7 +37,6 @@ // FlightGear #include
-#include #include "QmlAircraftInfo.hxx" #include "FavouriteAircraftData.hxx" diff --git a/src/GUI/InstallSceneryDialog.cxx b/src/GUI/InstallSceneryDialog.cxx index cf631569d..8167b7b05 100644 --- a/src/GUI/InstallSceneryDialog.cxx +++ b/src/GUI/InstallSceneryDialog.cxx @@ -18,6 +18,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#include "config.h" + #include "InstallSceneryDialog.hxx" #include "ui_InstallSceneryDialog.h" @@ -33,7 +35,6 @@ #include
#include
-#include #include diff --git a/src/GUI/LauncherController.cxx b/src/GUI/LauncherController.cxx index 84605c490..3ba248533 100644 --- a/src/GUI/LauncherController.cxx +++ b/src/GUI/LauncherController.cxx @@ -1,3 +1,5 @@ +#include "config.h" + #include "LauncherController.hxx" // Qt headers @@ -25,7 +27,6 @@ #include
#include
#include
-#include "version.h" #include "AircraftItemModel.hxx" #include "AircraftProxyModel.hxx" diff --git a/src/GUI/LauncherMainWindow.cxx b/src/GUI/LauncherMainWindow.cxx index f0a6971ae..4b3568f92 100755 --- a/src/GUI/LauncherMainWindow.cxx +++ b/src/GUI/LauncherMainWindow.cxx @@ -16,8 +16,6 @@ #include #include -#include "version.h" - // launcher headers #include "QtLauncher.hxx" #include "DefaultAircraftLocator.hxx" diff --git a/src/GUI/LocalAircraftCache.cxx b/src/GUI/LocalAircraftCache.cxx index cf0a17c6e..dda171dfd 100644 --- a/src/GUI/LocalAircraftCache.cxx +++ b/src/GUI/LocalAircraftCache.cxx @@ -31,7 +31,6 @@ #include #include -#include #include
#include
diff --git a/src/GUI/QmlAircraftInfo.cxx b/src/GUI/QmlAircraftInfo.cxx index 5a9ab703c..8d30444fd 100644 --- a/src/GUI/QmlAircraftInfo.cxx +++ b/src/GUI/QmlAircraftInfo.cxx @@ -1,3 +1,5 @@ +#include "config.h" + #include "QmlAircraftInfo.hxx" #include @@ -10,7 +12,6 @@ #include #include -#include #include
#include "LocalAircraftCache.hxx" diff --git a/src/GUI/SetupRootDialog.cxx b/src/GUI/SetupRootDialog.cxx index 789d88937..cc9ecb525 100755 --- a/src/GUI/SetupRootDialog.cxx +++ b/src/GUI/SetupRootDialog.cxx @@ -37,7 +37,6 @@ #include
#include
#include
-#include #include #include "QtLauncher.hxx" diff --git a/src/Include/config_cmake.h.in b/src/Include/config_cmake.h.in index 03731ed04..5a8b2c154 100644 --- a/src/Include/config_cmake.h.in +++ b/src/Include/config_cmake.h.in @@ -24,8 +24,7 @@ #cmakedefine HAVE_MKFIFO #define VERSION "@FLIGHTGEAR_VERSION@" - -#define HAVE_VERSION_H 1 // version.h is assumed for CMake builds +#define FLIGHTGEAR_VERSION "@FLIGHTGEAR_VERSION@" #cmakedefine ENABLE_UIUC_MODEL #cmakedefine ENABLE_LARCSIM diff --git a/src/Include/version.h.cmake-in b/src/Include/version.h.cmake-in deleted file mode 100644 index fa0a0accb..000000000 --- a/src/Include/version.h.cmake-in +++ /dev/null @@ -1,6 +0,0 @@ - -#define FLIGHTGEAR_VERSION "@FLIGHTGEAR_VERSION@" - - - - diff --git a/src/Instrumentation/mk_viii.cxx b/src/Instrumentation/mk_viii.cxx index 07a9734d6..58542a7c7 100644 --- a/src/Instrumentation/mk_viii.cxx +++ b/src/Instrumentation/mk_viii.cxx @@ -51,9 +51,7 @@ # pragma warning( disable: 4355 ) #endif -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include #include @@ -82,7 +80,6 @@ using std::string; #include #include -#include #include
#include
#include "instrument_mgr.hxx" diff --git a/src/Instrumentation/tcas.cxx b/src/Instrumentation/tcas.cxx index 8fffdfb9e..6900560b1 100644 --- a/src/Instrumentation/tcas.cxx +++ b/src/Instrumentation/tcas.cxx @@ -84,9 +84,7 @@ # pragma warning( disable: 4355 ) #endif -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include #include @@ -106,8 +104,6 @@ using std::string; -#include - /////////////////////////////////////////////////////////////////////////////// // debug switches ///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Main/bootstrap.cxx b/src/Main/bootstrap.cxx index 7d4119761..df7aa5d7d 100644 --- a/src/Main/bootstrap.cxx +++ b/src/Main/bootstrap.cxx @@ -59,7 +59,6 @@ #include #include "main.hxx" -#include #include #include
#include
diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 514ef684d..6cd12ddc6 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -136,7 +136,6 @@ #include #include #include -#include #include #include diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 631f79e8c..c48c054fb 100755 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -61,7 +61,6 @@ #include #include #include -#include #include #include "fg_commands.hxx" diff --git a/src/Main/options.cxx b/src/Main/options.cxx index fc6b07f35..76ece0962 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -80,7 +80,6 @@ #include "AircraftDirVisitorBase.hxx" #include -#include #include #include diff --git a/src/Main/sentryIntegration.cxx b/src/Main/sentryIntegration.cxx index 99ff33c6a..470bdae57 100644 --- a/src/Main/sentryIntegration.cxx +++ b/src/Main/sentryIntegration.cxx @@ -25,7 +25,6 @@ #include #include -#include #include
#include
#include
diff --git a/src/Network/DNSClient.cxx b/src/Network/DNSClient.cxx index 655d44d7e..79562b3da 100644 --- a/src/Network/DNSClient.cxx +++ b/src/Network/DNSClient.cxx @@ -18,12 +18,13 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#include "config.h" + #include "DNSClient.hxx" #include #include
-#include #include diff --git a/src/Network/HTTPClient.cxx b/src/Network/HTTPClient.cxx index 641599103..1015c9169 100644 --- a/src/Network/HTTPClient.cxx +++ b/src/Network/HTTPClient.cxx @@ -18,12 +18,13 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#include "config.h" + #include "HTTPClient.hxx" #include #include
-#include #include diff --git a/src/Network/flarm.cxx b/src/Network/flarm.cxx index ef8a8f7d0..aeeeced33 100644 --- a/src/Network/flarm.cxx +++ b/src/Network/flarm.cxx @@ -20,9 +20,7 @@ // // $Id$ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include #include @@ -37,7 +35,6 @@ #include #include
#include
-#include #include #include "flarm.hxx" diff --git a/src/Network/http/httpd.cxx b/src/Network/http/httpd.cxx index 9884aabf4..07a73a6da 100644 --- a/src/Network/http/httpd.cxx +++ b/src/Network/http/httpd.cxx @@ -18,6 +18,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#include "config.h" + #include "httpd.hxx" #include "HTTPRequest.hxx" #include "PropertyChangeWebsocket.hxx" @@ -31,7 +33,6 @@ #include "NavdbUriHandler.hxx" #include "PropertyChangeObserver.hxx" #include
-#include #include #include diff --git a/src/Network/igc.cxx b/src/Network/igc.cxx index c7d731c8b..1a827e196 100644 --- a/src/Network/igc.cxx +++ b/src/Network/igc.cxx @@ -24,11 +24,7 @@ * "fgfs --igc=file,out,1,OutputFile.igc" */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include +#include "config.h" #include // sprintf #include diff --git a/test_suite/dataStore.cxx b/test_suite/dataStore.cxx index b7cdb5637..e2306b196 100644 --- a/test_suite/dataStore.cxx +++ b/test_suite/dataStore.cxx @@ -18,14 +18,14 @@ * along with this program. If not, see . */ +#include "config.h" + #include #include #include
-#include -#include "config.h" #include "dataStore.hxx" diff --git a/utils/fgcom/fgcom_external.hxx b/utils/fgcom/fgcom_external.hxx index e59703069..9122ecf51 100644 --- a/utils/fgcom/fgcom_external.hxx +++ b/utils/fgcom/fgcom_external.hxx @@ -50,7 +50,6 @@ typedef int ssize_t; #include #include #include -#include "version.h" #ifndef FGCOM_VERSION #ifdef FLIGHTGEAR_VERSION