properly set dependencies for plugininfo.h
This commit is contained in:
parent
6d7274a789
commit
24cb7a6faf
@ -44,7 +44,7 @@ message("Qt version:" $$[QT_VERSION])
|
|||||||
|
|
||||||
plugininfo.depends = FORCE
|
plugininfo.depends = FORCE
|
||||||
for (entry, PLUGIN_DIRS):plugininfo.commands += test -d $${entry} || mkdir -p $${entry}; cd $${entry} && qmake -o Makefile $$PWD/$${entry}/$${entry}.pro && cd ..;
|
for (entry, PLUGIN_DIRS):plugininfo.commands += test -d $${entry} || mkdir -p $${entry}; cd $${entry} && qmake -o Makefile $$PWD/$${entry}/$${entry}.pro && cd ..;
|
||||||
for (entry, PLUGIN_DIRS):plugininfo.commands += make -C $${entry} plugininfo;
|
for (entry, PLUGIN_DIRS):plugininfo.commands += make -C $${entry} plugininfo.h;
|
||||||
QMAKE_EXTRA_TARGETS += plugininfo
|
QMAKE_EXTRA_TARGETS += plugininfo
|
||||||
|
|
||||||
# Translations:
|
# Translations:
|
||||||
|
|||||||
28
plugins.pri
28
plugins.pri
@ -8,8 +8,8 @@ QMAKE_LFLAGS += -std=c++11
|
|||||||
|
|
||||||
INCLUDEPATH += /usr/include/nymea
|
INCLUDEPATH += /usr/include/nymea
|
||||||
LIBS += -lnymea
|
LIBS += -lnymea
|
||||||
HEADERS += $${OUT_PWD}/plugininfo.h
|
HEADERS += $${OUT_PWD}/plugininfo.h \
|
||||||
|
$${OUT_PWD}/extern-plugininfo.h
|
||||||
|
|
||||||
PLUGIN_PATH=/usr/lib/$$system('dpkg-architecture -q DEB_HOST_MULTIARCH')/nymea/plugins/
|
PLUGIN_PATH=/usr/lib/$$system('dpkg-architecture -q DEB_HOST_MULTIARCH')/nymea/plugins/
|
||||||
|
|
||||||
@ -21,17 +21,30 @@ snappy{
|
|||||||
# Make the device plugin json file visible in the Qt Creator
|
# Make the device plugin json file visible in the Qt Creator
|
||||||
OTHER_FILES+=$$PWD/$${TARGET}/deviceplugin"$$TARGET".json
|
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
|
# Create plugininfo file
|
||||||
plugininfo.commands = nymea-generateplugininfo --filetype i --jsonfile $$PWD/$${TARGET}/deviceplugin"$$TARGET".json --output plugininfo.h --builddir $$OUT_PWD; \
|
plugininfo.target = $$OUT_PWD/plugininfo.h
|
||||||
nymea-generateplugininfo --filetype e --jsonfile $$PWD/$${TARGET}/deviceplugin"$$TARGET".json --output extern-plugininfo.h --builddir $$OUT_PWD;
|
plugininfo_dummy.target = plugininfo.h
|
||||||
plugininfo.depends = FORCE
|
plugininfo.depends = FORCE
|
||||||
QMAKE_EXTRA_TARGETS += plugininfo
|
plugininfo.commands = nymea-generateplugininfo --filetype i --jsonfile $$PWD/$${TARGET}/deviceplugin"$$TARGET".json --output plugininfo.h --builddir $$OUT_PWD
|
||||||
PRE_TARGETDEPS += plugininfo
|
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
|
||||||
|
|
||||||
# Install translation files
|
# Install translation files
|
||||||
TRANSLATIONS *= $$files($${PWD}/$${TARGET}/translations/*ts, true)
|
TRANSLATIONS *= $$files($${PWD}/$${TARGET}/translations/*ts, true)
|
||||||
lupdate.depends = FORCE
|
lupdate.depends = FORCE
|
||||||
lupdate.depends += plugininfo
|
lupdate.depends += plugininfo.h
|
||||||
lupdate.commands = lupdate -recursive -no-obsolete $$PWD/"$$TARGET"/"$$TARGET".pro;
|
lupdate.commands = lupdate -recursive -no-obsolete $$PWD/"$$TARGET"/"$$TARGET".pro;
|
||||||
QMAKE_EXTRA_TARGETS += lupdate
|
QMAKE_EXTRA_TARGETS += lupdate
|
||||||
|
|
||||||
@ -41,6 +54,5 @@ TRANSLATIONS += $$files($$[QT_SOURCE_TREE]/translations/*.ts, true)
|
|||||||
|
|
||||||
# Install plugin
|
# Install plugin
|
||||||
target.path = $$PLUGIN_PATH
|
target.path = $$PLUGIN_PATH
|
||||||
target.depends += plugininfo
|
|
||||||
INSTALLS += target translations
|
INSTALLS += target translations
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user