我使用win32
,macx
并unix:!macx
又名。我.pro
文件中的Linux if语句,用于指定操作系统特定的任务,例如
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
}
}
这工作得很好了if X else
,if X elseif X else
和if not X
这里X
是一个操作系统符。
有没有办法告诉qmake必须为os1
or编译一个块os2
?
您可以将|
运算符用于逻辑运算符or
。例如:
win32|macx {
HEADERS += debugging.h
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句