[Solved] qmake: test for emptiness (environment variable)
-
wrote on 6 Apr 2011, 07:16 last edited by
Hi all,
Yes another bottle thrown here, with few hopes to find a solution...
I'm trying to figure out how to check if an environment variable is set or not. Here is a test .pro that I'm using (ran my tests on Windows):
@_A = $(FOO)
message (>$$_A<)
isEmpty(_A){
message("empty")
}else{
message("not empty")
}@
output: ><
@Project MESSAGE:
Project MESSAGE: not empty@
To bad, cause to me _A is really empty (FOO is not any exported variable).
Any ideas? -
wrote on 6 Apr 2011, 07:29 last edited by
The operator for fetching environment variables when qmake is run is the $$(...) operator.
-
wrote on 6 Apr 2011, 08:25 last edited by
Thank you very much, it works indeed. What was confusing me is that @message ($(FOO))@ outputs @Project Message: <foo content>@
1/3