如何测试 qmake
.pro
文件中的变量是否为空或未定义?我想要
如果 undefined variable ,则能够设置默认值。
我试过了
eval("VARIABLE" = ""){
VARIABLE = test
}
eval("VARIABLE" = ""){
message(variable is empty)
}
但我仍然收到消息“变量为空”。
最佳答案
已经有函数 isEmpty我没发现:
isEmpty(VARIABLE){
VARIABLE = test
}
isEmpty(VARIABLE ){
message(variable is empty)
}
我不明白为什么 eval 不起作用……
关于qt - 测试变量是否为空并在 qmake 期间给出默认值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13803893/