TEMPLATE = lib
TARGET = $$qtLibraryTarget(nymea_energypluginnymea)

CONFIG += plugin link_pkgconfig

PKGCONFIG += nymea nymea-energy

QT *= network dbus

include(energyplugin.pri)

HEADERS += \
    energypluginnymea.h

SOURCES += \
    energypluginnymea.cpp

target.path = $$[QT_INSTALL_LIBS]/nymea/energy/
INSTALLS += target

# Install translation files
TRANSLATIONS *= $$files($${_PRO_FILE_PWD_}/translations/*ts, true)
lupdate.depends = FORCE
lupdate.depends += qmake_all
lupdate.commands = lupdate -recursive -no-obsolete $${_PRO_FILE_PWD_}/nymea-energy-plugin-nymea.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);
QMAKE_EXTRA_TARGETS += lrelease

translations.depends += lrelease
translations.path = /usr/share/nymea/translations
translations.files = $$_PRO_FILE_PWD_/translations/*.qm
message("Translation files: $${translations.files}")
INSTALLS += translations
