Different qmake settings for Arm and Linux builds

Within Qt application, we can use #ifdef Q_WS_QWS block to conditionally compile parts of the code for QtEmbedded.

But we can’t give specific LIBS or INCLUDEPATH directives in our .pro file.

It is possible to use platform specific directives like below:

win32 {
    SOURCES += NetworkWin.cpp
}

But how can I differentiate builds for Linux desktop and builds for Linux on Arm with cross toolchain?

It is possible to give different rules for each mkspec targets specified in QMAKESPEC directory like linux-arm-gnueabi-g++.

You can use it as:

linux-arm-gnueabi-g++ {
LIBS += -L$$PWD/../my_platform/lib
LIBS += -lmy_platformlib
} else {
LIBS += -ldesktop
}
1 Like