$$访问变量
作用域
作用域类似if语句在程序编程语言。如果某一个条件为真,处理范围内的声明。
For example:
win32 {
SOURCES += paintwidget_win.cpp
}
!win32 {
SOURCES -= paintwidget_win.cpp
}
macx {
CONFIG(debug, debug|release) {
HEADERS += debugging.h
}
}
macx:CONFIG(debug, debug|release) {
HEADERS += debugging.h
}
win32:DEFINES += USE_MY_STUFF
win32|macx {
HEADERS += debugging.h
}
win32:xml {
message(Building for Windows)
SOURCES += xmlhandler_win.cpp
} else:xml {
SOURCES += xmlhandler.cpp
} else {
message("Unknown configuration")
}
Configuration and Scopes
CONFIG += opengl
opengl {//CONFIG配置了opengl
TARGET = application-gl
} else {//CONFIG没有配置opengl
TARGET = application
}
Platform Scope Values
message($$QMAKESPEC)
linux-g++ {
message(Linux)
}