Skip to content

Commit

Permalink
conditionally build with mqtt to allow dev without this deps
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Sep 25, 2024
1 parent f751b45 commit feed3a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
11 changes: 8 additions & 3 deletions calaos_installer.pro
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
QT += core gui network widgets xml printsupport mqtt
QT += core gui network widgets xml printsupport

qtHaveModule(mqtt) {
QT += mqtt
DEFINES += QT_MQTT_AVAILABLE
SOURCES += src/DialogZigbee2mqtt.cpp
HEADERS += src/DialogZigbee2mqtt.h
}

equals(QT_MAJOR_VERSION, 6) {
QT += core5compat
Expand All @@ -19,7 +26,6 @@ CONFIG += c++11
TARGET = calaos_installer
TEMPLATE = app
SOURCES += src/main.cpp \
src/DialogZigbee2mqtt.cpp \
src/SimpleCrypt.cpp \
src/mainwindow.cpp \
src/common/base64.c \
Expand Down Expand Up @@ -111,7 +117,6 @@ SOURCES += src/main.cpp \
src/FormActionPush.cpp

HEADERS += src/mainwindow.h \
src/DialogZigbee2mqtt.h \
src/SimpleCrypt.h \
src/common/Utils.h \
src/common/base64.h \
Expand Down
5 changes: 5 additions & 0 deletions src/formrules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
#include "DialogNewAVReceiver.h"
#include "dialognewwebioshutter.h"
#include "wizards/hue/wizardhue.h"

#ifdef QT_MQTT_AVAILABLE
#include "DialogZigbee2mqtt.h"
#endif

FormRules::FormRules(QWidget *parent) :
QWidget(parent),
Expand Down Expand Up @@ -671,6 +674,7 @@ FormRules::FormRules(QWidget *parent) :
addCalaosIO(p);
});

#ifdef QT_MQTT_AVAILABLE
action = add_menu->addAction(tr("Zigbee2mqtt device"));
action->setIcon(QIcon(":/img/zigbee2mqtt.png"));
connect(action, &QAction::triggered, this, [=]()
Expand All @@ -691,6 +695,7 @@ FormRules::FormRules(QWidget *parent) :
addCalaosIO(p);
}
});
#endif

add_menu->addSeparator();

Expand Down

0 comments on commit feed3a6

Please sign in to comment.