[Solved] qmake: test for emptiness (environment variable)



  • 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?



  • The operator for fetching environment variables when qmake is run is the $$(...) operator.



  • Thank you very much, it works indeed. What was confusing me is that @message ($(FOO))@ outputs @Project Message: <foo content>@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.