test if a variable is empty and give default value during qmake
qmake, qt
Solution
there is already the function isEmpty I didn't spot:
isEmpty(VARIABLE){
VARIABLE = test
}
isEmpty(VARIABLE ){
message(variable is empty)
}
I don't understand why eval didnt work thought...
Problem
How can you test if a variable is empty or not defined in a `qmake` `.pro` file? I want to be able to set up a default value if the variable is not defined. I tried ``` eval("VARIABLE" = ""){ VARIABLE = test } eval("VARIABLE" = ""){ message(variable is empty) } ``` but I still get the message "variable is empty".