Merge PR #125: Use the new nymea-plugininfocompiler for building

This commit is contained in:
Jenkins 2019-07-22 12:17:14 +02:00
commit e33f9e0946
3 changed files with 23 additions and 58 deletions

5
debian/changelog vendored
View File

@ -1,3 +1,8 @@
nymea-plugins (0.15.0) UNRELEASED; urgency=medium
-- Michael Zanetti <michael.zanetti@guh.io> Wed, 26 Jun 2019 21:44:29 +0200
nymea-plugins (0.12.3) xenial; urgency=medium nymea-plugins (0.12.3) xenial; urgency=medium
[ Michael Zanetti ] [ Michael Zanetti ]

2
debian/control vendored
View File

@ -7,6 +7,8 @@ Build-depends: libboblight-dev,
libnymea1-dev, libnymea1-dev,
libnymea-mqtt-dev, libnymea-mqtt-dev,
libqt5serialport5-dev, libqt5serialport5-dev,
libqt5websockets5-dev,
nymea-dev-tools:native,
pkg-config, pkg-config,
python:any, python:any,
qtbase5-dev, qtbase5-dev,

View File

@ -1,59 +1,17 @@
TEMPLATE = lib isEmpty(PLUGIN_PRI) {
CONFIG += plugin exists($$[QT_INSTALL_PREFIX]/include/nymea/plugin.pri) {
include($$[QT_INSTALL_PREFIX]/include/nymea/plugin.pri)
QMAKE_CXXFLAGS += -Werror -std=c++11 -g } else {
QMAKE_LFLAGS += -std=c++11 message("plugin.pri not found. Either install libnymea1-dev or use the PLUGIN_PRI argument to point to it.")
message("For building this project without nymea installed system-wide, you will want to export those variables in addition:")
CONFIG += link_pkgconfig message("PKG_CONFIG_PATH=/path/to/build-nymea/libnymea/pkgconfig/")
PKGCONFIG += nymea message("CPATH=/path/to/nymea/libnymea/")
message("LIBRARY_PATH=/path/to/build-nymea/libnymea/")
HEADERS += $${OUT_PWD}/plugininfo.h \ message("PATH=/path/to/build-nymea/tools/nymea-plugininfocompiler:$PATH")
$${OUT_PWD}/extern-plugininfo.h message("LD_LIBRARY_PATH=/path/to/build-nymea/libnymea/")
error("plugin.pri not found. Cannot continue")
# Check if this is a snap build }
snappy{ } else {
INCLUDEPATH+=$$(SNAPCRAFT_STAGE)/usr/include/nymea message("Using $$PLUGIN_PRI")
include($$PLUGIN_PRI)
} }
# Make the device plugin json file visible in the Qt Creator
OTHER_FILES += $$PWD/$${TARGET}/deviceplugin"$$TARGET".json
# NOTE: if the code includes "plugininfo.h", it would fail if we only give it a compiler for $$OUT_PWD/plugininfo.h
# Let's add a dummy target with the plugininfo.h file without any path to allow the developer to just include it like that.
# Create plugininfo file
plugininfo.target = $$OUT_PWD/plugininfo.h
plugininfo_dummy.target = plugininfo.h
plugininfo.depends = FORCE
plugininfo.commands = nymea-generateplugininfo --filetype i --jsonfile $$PWD/$${TARGET}/deviceplugin"$$TARGET".json --output plugininfo.h --builddir $$OUT_PWD
plugininfo_dummy.commands = $$plugininfo.commands
QMAKE_EXTRA_TARGETS += plugininfo plugininfo_dummy
# Create extern-plugininfo file
extern_plugininfo.target = $$OUT_PWD/extern-plugininfo.h
extern_plugininfo_dummy.target = extern-plugininfo.h
extern_plugininfo.depends = FORCE
extern_plugininfo.commands = nymea-generateplugininfo --filetype e --jsonfile $$PWD/$${TARGET}/deviceplugin"$$TARGET".json --output extern-plugininfo.h --builddir $$OUT_PWD
extern_plugininfo_dummy.commands = $$extern_plugininfo.commands
QMAKE_EXTRA_TARGETS += extern_plugininfo extern_plugininfo_dummy
# Clean up autogenerated plugin info files
plugininfo_clean.commands = rm -fv $$OUT_PWD/plugininfo.h $$OUT_PWD/extern-plugininfo.h
clean.depends = plugininfo_clean
QMAKE_EXTRA_TARGETS += clean plugininfo_clean
# Install translation files
TRANSLATIONS *= $$files($${PWD}/$${TARGET}/translations/*ts, true)
lupdate.depends = FORCE
lupdate.depends += plugininfo.h
lupdate.commands = lupdate -recursive -no-obsolete $$PWD/"$$TARGET"/"$$TARGET".pro;
QMAKE_EXTRA_TARGETS += lupdate
translations.path = /usr/share/nymea/translations
translations.files = $$[QT_SOURCE_TREE]/translations/*.qm
TRANSLATIONS += $$files($$[QT_SOURCE_TREE]/translations/*.ts, true)
# Install plugin
target.path = $$[QT_INSTALL_LIBS]/nymea/plugins/
INSTALLS += target translations