Fix build with WITH_BINDINGS=yes and WITH_QTSERIALPORT=no

auto_generated/sensor/qgsabstractsensor.sip: In function ‘const sipTypeDef* sipSubClass_QgsAbstractSensor(void**)’:
auto_generated/sensor/qgsabstractsensor.sip:35: error: ‘QgsSerialPortSensor’ does not name a type; did you mean ‘sipName_QgsSerialPortSensor’?
This commit is contained in:
Chris Mayo 2023-06-24 17:25:28 +01:00 committed by Nyall Dawson
parent 7df22c4d1e
commit ecdb1e2989
6 changed files with 13 additions and 0 deletions

View File

@ -170,6 +170,10 @@ if(NOT WITH_GUI)
set(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} HAVE_GUI)
endif()
if(NOT WITH_QTSERIALPORT)
set(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} HAVE_QTSERIALPORT)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/core/project.py.in ${CMAKE_CURRENT_BINARY_DIR}/core/project.py @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/core/pyproject.toml.in ${CMAKE_CURRENT_BINARY_DIR}/core/pyproject.toml @ONLY)
GENERATE_SIP_PYTHON_MODULE_CODE(qgis._core core/core.sip "${sip_files_core}" cpp_files)

View File

@ -32,10 +32,12 @@ An abstract base class for sensor classes
{
sipType = sipType_QgsUdpSocketSensor;
}
#if defined( HAVE_QTSERIALPORT )
else if ( item->type() == QLatin1String( "serial_port" ) && dynamic_cast<QgsSerialPortSensor *>( item ) != NULL )
{
sipType = sipType_QgsSerialPortSensor;
}
#endif
else
{
sipType = sipType_QgsAbstractSensor;

View File

@ -184,6 +184,7 @@ Sets the ``port`` the socket connects to.
};
%If (HAVE_QTSERIALPORT)
class QgsSerialPortSensor : QgsIODeviceSensor
{
@ -239,6 +240,7 @@ Sets the serial port the sensor connects to.
};
%End

View File

@ -100,6 +100,7 @@ done:
%Import QtPositioning/QtPositioningmod.sip
%Feature HAVE_GUI
%Feature HAVE_QTSERIALPORT
%Feature ANDROID
%Feature VECTOR_MAPPED_TYPE

View File

@ -50,10 +50,12 @@ class CORE_EXPORT QgsAbstractSensor : public QObject
{
sipType = sipType_QgsUdpSocketSensor;
}
#if defined( HAVE_QTSERIALPORT )
else if ( item->type() == QLatin1String( "serial_port" ) && dynamic_cast<QgsSerialPortSensor *>( item ) != NULL )
{
sipType = sipType_QgsSerialPortSensor;
}
#endif
else
{
sipType = sipType_QgsAbstractSensor;

View File

@ -220,6 +220,7 @@ class CORE_EXPORT QgsUdpSocketSensor : public QgsIODeviceSensor
};
#if defined( HAVE_QTSERIALPORT )
SIP_IF_FEATURE( HAVE_QTSERIALPORT )
/**
* \ingroup core
@ -279,6 +280,7 @@ class CORE_EXPORT QgsSerialPortSensor : public QgsIODeviceSensor
QString mPortName;
};
SIP_END
#endif
#endif //QGSIODEVICESENSOR_H