qmake整理二

来源:互联网 发布:php 数值类型 编辑:程序博客网 时间:2024/06/01 03:57

$$访问变量

这里写图片描述

作用域

作用域类似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 += openglopengl {//CONFIG配置了opengl    TARGET = application-gl} else {//CONFIG没有配置opengl    TARGET = application}

Platform Scope Values

message($$QMAKESPEC)linux-g++ {    message(Linux)}
0 0
原创粉丝点击