Make TI optional based on package detection in qt5 depending
This commit is contained in:
parent
63e9e424d3
commit
e9c26ee85a
@ -17,7 +17,13 @@ greaterThan(QT_MAJOR_VERSION, 5) {
|
||||
message(Building without TI support)
|
||||
DEFINES += DISABLE_TI
|
||||
} else {
|
||||
PKGCONFIG += qca2-qt5
|
||||
packagesExist(qca2-qt5) {
|
||||
message(Build with libqca2 support)
|
||||
PKGCONFIG += qca2-qt5
|
||||
} else {
|
||||
message(Build without libqca2 support)
|
||||
DEFINES += DISABLE_TI
|
||||
}
|
||||
}
|
||||
|
||||
SOURCES += \
|
||||
|
||||
@ -43,7 +43,7 @@ public:
|
||||
enum ZigbeeBackendType {
|
||||
ZigbeeBackendTypeDeconz,
|
||||
ZigbeeBackendTypeNxp,
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#ifndef DISABLE_TI
|
||||
ZigbeeBackendTypeTi
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
#include "backends/nxp/zigbeenetworknxp.h"
|
||||
#include "backends/deconz/zigbeenetworkdeconz.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#ifndef DISABLE_TI
|
||||
#include "backends/ti/zigbeenetworkti.h"
|
||||
#endif
|
||||
|
||||
@ -51,7 +51,7 @@ ZigbeeNetwork *ZigbeeNetworkManager::createZigbeeNetwork(const QUuid &networkUui
|
||||
return qobject_cast<ZigbeeNetwork *>(new ZigbeeNetworkNxp(networkUuid, parent));
|
||||
case Zigbee::ZigbeeBackendTypeDeconz:
|
||||
return qobject_cast<ZigbeeNetwork *>(new ZigbeeNetworkDeconz(networkUuid, parent));
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#ifndef DISABLE_TI
|
||||
case Zigbee::ZigbeeBackendTypeTi:
|
||||
return qobject_cast<ZigbeeNetwork *>(new ZigbeeNetworkTi(networkUuid, parent));
|
||||
#endif
|
||||
|
||||
@ -239,7 +239,7 @@ void ZigbeeUartAdapterMonitor::addAdapterInternally(const QString &serialPort)
|
||||
adapter.setBaudRate(115200);
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#ifndef DISABLE_TI
|
||||
QStringList zStackModels = {"cc2530", "cc2531", "cc2538", "cc1352p", "cc2652p", "cc2652r", "cc2652rb", "sonoff zigbee 3.0 usb"};
|
||||
if (QRegularExpression(".*(" + zStackModels.join("|") + ").*").match(serialPortInfo.description().toLower()).hasMatch()) {
|
||||
adapter.setHardwareRecognized(true);
|
||||
|
||||
Reference in New Issue
Block a user