Skip to content
Advertisement

qmake match linux and mac separatly

I’m creating a .pro file for both Mac and Linux platform.

I will link the qca framework on Mac, and libqca on Linux

mac {
    ICON = mac.icns
    INCLUDEPATH += /usr/local/homebrew/Cellar/qca/2.1.0/include/
    LIBS += -F/usr/local/homebrew/Cellar/qca/2.1.0/lib -framework qca
}

unix {
    LIBS += -lqca
}

However, the unix part matches both mac and linux, any ideas?

Advertisement

Answer

You can use the colon : to take a product (logical-and) of multiple conditions, some of which may be negated:

unix:!mac {
  ...
}
Advertisement