[SOLVED] How to compare value of a custom variable with constant in the *.pro file?
-
Could you please advise how does equals function work?
I wont to use "equals ":https://qt-project.org/doc/qt-5.1/qmake/qmake-test-function-reference.html#equals-variablename-value function in the pro file:
_equals(variablename, value)
Tests whether variablename equals the string value.
For example:
TARGET = helloworld
equals(TARGET, "helloworld") {
message("The target assignment was successful.")
}
_So I've created following test pro file:
@
QT += core gui widgetsTEMPLATE = app
test_variable = 1message(test variable value = $$test_variable)
equals(test_variable, "1")
{
message("1")
}equals(test_variable, "2")
{
message("2")
}
@In the result I have :
Project MESSAGE: test variable value = 1
Project MESSAGE: 1
Project MESSAGE: 2So both cases are occurred! I was trying equals($$(test_variable), "1") and it also doesn't work.
How Can I compare custom variable value with any constant (or value of other variable)?
-