https://github.com/zytc2009/BigTeam_learning
分类: C/C++
2009-08-03 09:22:25
qmake的语法是
条件{
...执行的动作1...
}else{
...执行的动作2...
}
所以如果要执行根据版本控制的代码可以用
greaterThan(QT_MAJOR_VERSION, 4)|equals(QT_MAJOR_VERSION,4){
greaterThan(QT_MINOR_VERSION, 5)|equals(QT_MINOR_VERSION, 5){
message("bla,bla,bla ....")
}
}else{
message("pla,pla,pla ....")
}
不过需要注意的是,greaterThan和equals是在qmake代码里没有公布的,详细需要看qmake的源代码
qt/qmake/project.cpp
116 if(!qmake_test_functions) {
117 qmake_test_functions = new QMap;
118 qmake_test_functions->insert("requires", T_REQUIRES);
119 qmake_test_functions->insert("greaterThan", T_GREATERTHAN);
120 qmake_test_functions->insert("lessThan", T_LESSTHAN);
121 qmake_test_functions->insert("equals", T_EQUALS);
122 qmake_test_functions->insert("isEqual", T_EQUALS);