diff --git a/ground/openpilotgcs/src/app/app.pro b/ground/openpilotgcs/src/app/app.pro index 9d5c1446b..d2c1880e0 100644 --- a/ground/openpilotgcs/src/app/app.pro +++ b/ground/openpilotgcs/src/app/app.pro @@ -1,13 +1,14 @@ include(../../openpilotgcs.pri) include(../shared/qtsingleapplication/qtsingleapplication.pri) -include(gcsversioninfo.pri) +include(version_info.pri) TEMPLATE = app TARGET = $$GCS_APP_TARGET DESTDIR = $$GCS_APP_PATH QT += xml SOURCES += main.cpp \ - gcssplashscreen.cpp + gcssplashscreen.cpp \ + version_info.cpp include(../rpath.pri) include(../libs/utils/utils.pri) diff --git a/ground/openpilotgcs/src/app/version_info.cpp b/ground/openpilotgcs/src/app/version_info.cpp new file mode 100644 index 000000000..e3c712483 --- /dev/null +++ b/ground/openpilotgcs/src/app/version_info.cpp @@ -0,0 +1,27 @@ +/** + ****************************************************************************** + * @file version_info.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2013. + * @addtogroup VersionInfo + * @{ + * @brief This file includes autogenerated version info data file. + * The autogenerated file is build by app/version_info.pri. + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "../version_info.h" +#include "../../../../build/openpilotgcs-synthetics/version_info.cpp" diff --git a/ground/openpilotgcs/src/app/version_info.cpp.template b/ground/openpilotgcs/src/app/version_info.cpp.template new file mode 100644 index 000000000..214ad7b3b --- /dev/null +++ b/ground/openpilotgcs/src/app/version_info.cpp.template @@ -0,0 +1,48 @@ +/** + ****************************************************************************** + * @file version_info.cpp.template + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2013. + * @addtogroup VersionInfo + * @{ + * @brief The template file used to generate the real source file called + * build/openpilotgcs-synthetics/version_info.cpp + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +VersionInfo::VersionInfo() +{ +} + +QString VersionInfo::revision() +{ + return "${REVISION}"; +} + +QString VersionInfo::year() +{ + return "${YEAR}"; +} + +QString VersionInfo::origin() +{ + return "${ORIGIN}"; +} + +QString VersionInfo::uavoHash() +{ + return "{ ${UAVOSHA1} }"; +} diff --git a/ground/openpilotgcs/src/app/gcsversioninfo.pri b/ground/openpilotgcs/src/app/version_info.pri similarity index 84% rename from ground/openpilotgcs/src/app/gcsversioninfo.pri rename to ground/openpilotgcs/src/app/version_info.pri index bec785f58..e8a5ccbe1 100644 --- a/ground/openpilotgcs/src/app/gcsversioninfo.pri +++ b/ground/openpilotgcs/src/app/version_info.pri @@ -1,5 +1,5 @@ # -# This qmake file generates a header with the GCS version info string. +# This qmake file generates a version info class implementation. # # This is a bit tricky since the script should be run always and before # the other dependencies evaluation. @@ -32,20 +32,20 @@ PYTHON_DIR = python-2.7.4 # Define other variables VERSION_INFO_DIR = $$GCS_BUILD_TREE/../openpilotgcs-synthetics - VERSION_INFO_HEADER = $$VERSION_INFO_DIR/gcs_version_info.h VERSION_INFO_SCRIPT = $$ROOT_DIR/make/scripts/version-info.py - VERSION_INFO_TEMPLATE = $$ROOT_DIR/make/templates/gcs_version_info.h.template VERSION_INFO_COMMAND = $$PYTHON \"$$VERSION_INFO_SCRIPT\" + VERSION_INFO_TEMPLATE = $$GCS_SOURCE_TREE/src/app/version_info.cpp.template + VERSION_INFO_FILE = $$VERSION_INFO_DIR/version_info.cpp UAVO_DEF_PATH = $$ROOT_DIR/shared/uavobjectdefinition - # Create custom version_info target which generates a header - version_info.target = $$VERSION_INFO_HEADER + # Create custom version_info target which generates a real file + version_info.target = $$VERSION_INFO_FILE version_info.commands = -$(MKDIR) $$targetPath($$VERSION_INFO_DIR) $$addNewline() version_info.commands += $$VERSION_INFO_COMMAND \ --path=\"$$GCS_SOURCE_TREE\" \ --template=\"$$VERSION_INFO_TEMPLATE\" \ --uavodir=\"$$UAVO_DEF_PATH\" \ - --outfile=\"$$VERSION_INFO_HEADER\" + --outfile=\"$$VERSION_INFO_FILE\" version_info.depends = FORCE QMAKE_EXTRA_TARGETS += version_info diff --git a/ground/openpilotgcs/src/gcs_version_info.h b/ground/openpilotgcs/src/gcs_version_info.h deleted file mode 100644 index 4f4bc2261..000000000 --- a/ground/openpilotgcs/src/gcs_version_info.h +++ /dev/null @@ -1,6 +0,0 @@ -// -// This file includes autogenerated version info header used by other plugins. -// The autogenerated file is build by app/gcsversioninfo.pri. -// - -#include "../../../build/openpilotgcs-synthetics/gcs_version_info.h" diff --git a/ground/openpilotgcs/src/version_info.h b/ground/openpilotgcs/src/version_info.h new file mode 100644 index 000000000..b517e7307 --- /dev/null +++ b/ground/openpilotgcs/src/version_info.h @@ -0,0 +1,40 @@ +/** + ****************************************************************************** + * @file version_info.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2013. + * @addtogroup VersionInfo + * @{ + * @brief GCS version info class header. + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef VERSION_INFO_H +#define VERSION_INFO_H + +#include + +class VersionInfo { +public: + static QString revision(); + static QString year(); + static QString origin(); + static QString uavoHash(); +private: + VersionInfo(); +}; + +#endif // VERSION_INFO_H