I am using win32, macx and unix:!macx aka. Linux if statements in my .pro file, to specify os specific tasks, e.g.
win32 {
TARGET = myapp
RC_FILE = myapp.rc
}
macx {
TARGET = MyApp
ICON = myapp.icns
QMAKE_INFO_PLIST = Info.plist
}
unix:!macx { # linux
CONFIG(debug, debug|release) {
TARGET = myapp-debug
}
CONFIG(release, debug|release) {
TARGET = myapp
}
}
This works fine for if X else, if X elseif X else, and if not X where X is an os specifier.
Is there a way to tell qmake it must compile a block for os1 or os2?
You can use the | operator for a logical or. For example:
win32|macx {
HEADERS += debugging.h
}
http://doc.qt.io/qt-4.8/qmake-advanced-usage.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With