1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-955: replace gcs_version_info.h by version_info.h and version_info.cpp

This commit breaks the build. Other files should be updated accordingly.
This commit is contained in:
Oleg Semyonov 2013-05-17 21:44:11 +03:00
parent e0de2083af
commit 76be45242c
6 changed files with 124 additions and 14 deletions

View File

@ -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)

View File

@ -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"

View File

@ -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} }";
}

View File

@ -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

View File

@ -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"

View File

@ -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 <QString>
class VersionInfo {
public:
static QString revision();
static QString year();
static QString origin();
static QString uavoHash();
private:
VersionInfo();
};
#endif // VERSION_INFO_H