mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
Merge branch 'os_gcs-version-info' into packaging
This commit is contained in:
commit
91f5fd2318
@ -141,3 +141,5 @@ unix:!macx {
|
||||
INSTALLS += images
|
||||
}
|
||||
OTHER_FILES += Core.pluginspec
|
||||
|
||||
include(gcsversioninfo.pri)
|
||||
|
@ -0,0 +1,35 @@
|
||||
#
|
||||
# This qmake file generates a header with the GCS version info string.
|
||||
#
|
||||
# This is a bit tricky since the script should be run always and before
|
||||
# the other dependencies evaluation.
|
||||
#
|
||||
|
||||
# Since debug_and_release option is set, we need this
|
||||
!debug_and_release|build_pass {
|
||||
ROOT_DIR = $$GCS_SOURCE_TREE/../..
|
||||
VERSION_INFO_HEADER = $$GCS_BUILD_TREE/gcsversioninfo.h
|
||||
VERSION_INFO_SCRIPT = $$ROOT_DIR/make/scripts/version-info.py
|
||||
VERSION_INFO_TEMPLATE = $$ROOT_DIR/make/templates/gcsversioninfotemplate.h
|
||||
VERSION_INFO_COMMAND = python \"$$VERSION_INFO_SCRIPT\"
|
||||
|
||||
# Create custom version_info target which generates a header
|
||||
version_info.target = $$VERSION_INFO_HEADER
|
||||
version_info.commands = $$VERSION_INFO_COMMAND \
|
||||
--path=\"$$GCS_SOURCE_TREE\" \
|
||||
--template=\"$$VERSION_INFO_TEMPLATE\" \
|
||||
--outfile=\"$$VERSION_INFO_HEADER\"
|
||||
version_info.depends = FORCE
|
||||
QMAKE_EXTRA_TARGETS += version_info
|
||||
|
||||
# Hook version_info target in between qmake's Makefile update and
|
||||
# the actual project target
|
||||
version_info_hook.depends = version_info
|
||||
debug_and_release {
|
||||
CONFIG(debug,debug|release):version_info_hook.target = Makefile.Debug
|
||||
CONFIG(release,debug|release):version_info_hook.target = Makefile.Release
|
||||
} else {
|
||||
version_info_hook.target = Makefile
|
||||
}
|
||||
QMAKE_EXTRA_TARGETS += version_info_hook
|
||||
}
|
@ -65,7 +65,7 @@ VersionDialog::VersionDialog(QWidget *parent)
|
||||
QString ideRev;
|
||||
#ifdef GCS_REVISION
|
||||
//: This gets conditionally inserted as argument %8 into the description string.
|
||||
ideRev = tr("From revision %1<br/>").arg(QString::fromLatin1(GCS_REVISION_STR).left(10));
|
||||
ideRev = tr("From revision %1<br/>").arg(QString::fromLatin1(GCS_REVISION_STR).left(60));
|
||||
#endif
|
||||
|
||||
const QString description = tr(
|
||||
|
@ -29,6 +29,9 @@
|
||||
#ifndef VERSIONDIALOG_H
|
||||
#define VERSIONDIALOG_H
|
||||
|
||||
// autogenerated version info string
|
||||
#include "../../../../../build/ground/openpilotgcs/gcsversioninfo.h"
|
||||
|
||||
#include <QtGui/QDialog>
|
||||
|
||||
namespace Core {
|
||||
|
32
make/templates/gcsversioninfotemplate.h
Normal file
32
make/templates/gcsversioninfotemplate.h
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file ${OUTFILENAME}
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011.
|
||||
* @brief GCS revision info file autogenerated using template
|
||||
* ${TEMPLATE}
|
||||
*
|
||||
* @see The GNU Public License (GPL) Version 3
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#define GCS_REVISION ${TAG_OR_BRANCH}:${HASH8}${DIRTY} ${DATETIME}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
Loading…
Reference in New Issue
Block a user