add a plugin.pri file for use with external plugins
This commit is contained in:
parent
f62adfb088
commit
a2c53a762d
2
debian/libnymea1-dev.install.in
vendored
2
debian/libnymea1-dev.install.in
vendored
@ -1,4 +1,4 @@
|
||||
usr/lib/@DEB_HOST_MULTIARCH@/libnymea.so
|
||||
usr/include/nymea/* usr/include/nymea
|
||||
usr/bin/nymea-generateplugininfo usr/bin
|
||||
|
||||
libnymea/plugin/plugin.pri usr/include/nymea/
|
||||
|
||||
80
libnymea/plugin/plugin.pri
Normal file
80
libnymea/plugin/plugin.pri
Normal file
@ -0,0 +1,80 @@
|
||||
# Copyright (C) 2018 Michael Zanetti <michael.zanetti@guh.io>
|
||||
#
|
||||
# This file is part of nymea.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This project include file is meant to be used by nymea plugins.
|
||||
# Example project file for a plugin:
|
||||
|
||||
# include(/usr/include/nymea/plugi.pri)
|
||||
# TARGET = $$qtLibraryTarget(nymea_devicepluginexample)
|
||||
# SOURCES += devicepluginexample.cpp
|
||||
# HEADERS += devicepluginexample.h
|
||||
|
||||
|
||||
TEMPLATE = lib
|
||||
CONFIG += plugin
|
||||
|
||||
INCLUDEPATH += /usr/include/nymea
|
||||
LIBS += -lnymea
|
||||
|
||||
PLUGIN_PATH=/usr/lib/$$system('dpkg-architecture -q DEB_HOST_MULTIARCH')/nymea/plugins/
|
||||
|
||||
# Make the device plugin json file visible in the Qt Creator
|
||||
OTHER_FILES+=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 $${_PRO_FILE_PWD_}/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 $${_PRO_FILE_PWD_}/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
|
||||
|
||||
# Install translation files
|
||||
TRANSLATIONS *= $$files($${_PRO_FILE_PWD_}/translations/*ts, true)
|
||||
lupdate.depends = FORCE
|
||||
lupdate.depends += plugininfo
|
||||
lupdate.commands = lupdate -recursive -no-obsolete $$PWD/"$$TARGET".pro;
|
||||
QMAKE_EXTRA_TARGETS += lupdate
|
||||
|
||||
# make lrelease to build .qm from .ts
|
||||
lrelease.depends = FORCE
|
||||
lrelease.commands += lrelease $$files($$_PRO_FILE_PWD_/translations/*.ts, true);
|
||||
lrelease.commands += rsync -a $${_PRO_FILE_PWD_}/translations/*.qm $${OUT_PWD}/translations/;
|
||||
QMAKE_EXTRA_TARGETS += lrelease
|
||||
|
||||
translations.path = /usr/share/nymea/translations
|
||||
translations.files = $$[QT_SOURCE_TREE]/translations/*.qm
|
||||
|
||||
HEADERS += $$OUT_PWD/plugininfo.h \
|
||||
$$OUT_PWD/extern-plugininfo.h
|
||||
DEPENDPATH += $$OUT_PWD
|
||||
|
||||
# Install plugin
|
||||
target.path = $$PLUGIN_PATH
|
||||
INSTALLS += target translations
|
||||
Reference in New Issue
Block a user