[Interest] Qmake: Detecting if QSerialPort is installed

André Hartmann andre.hartmann at iseg-hv.de
Thu Mar 10 09:10:49 CET 2016


Hi all,

I'm working on a library that (optionally) depends on QSerialPort.

This library should also compile on Qt 4, so I did the following in the 
project file:

greaterThan(QT_MAJOR_VERSION, 4) {
         QT += serialport
} else {
         CONFIG += serialport
}

Thats fine so far, but if QSerialPort is not installed for the 
corresponding Qt4 version, I'd like to get a message during the qmake run.

What's the easiest way to do this with qmake?

Best regards,
Andre



More information about the Interest mailing list