!mac:qtAddLibrary(QtSerialPort)

!isEmpty(QTSERIALPORT_BUILD_ROOT) {
    INCLUDEPATH -= $$QMAKE_INCDIR_QT/QtSerialPort
    QMAKE_INCDIR += $$QTSERIALPORT_BUILD_ROOT/include $$QTSERIALPORT_BUILD_ROOT/include/QtSerialPort

    QTSERIALPORT_BUILD_SUBDIR = src/serialport
    debug_and_release_target {
        CONFIG(debug, debug|release) {
            QTSERIALPORT_BUILD_SUBDIR = $$QTSERIALPORT_BUILD_SUBDIR/debug
        } else {
            QTSERIALPORT_BUILD_SUBDIR = $$QTSERIALPORT_BUILD_SUBDIR/release
        }
    }

    QMAKE_LIBDIR += $$QTSERIALPORT_BUILD_ROOT/$$QTSERIALPORT_BUILD_SUBDIR
}

mac {
    INCLUDEPATH += $$[QT_INSTALL_HEADERS]/QtSerialPort

   if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
       LIBS += -lQtSerialPort$${QT_LIBINFIX}_debug
   } else {
       LIBS += -lQtSerialPort$${QT_LIBINFIX}
   }
}
