Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [Solved] qmake: test for emptiness (environment variable)
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 6.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dword
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on last edited by
      #2

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

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dword
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved