title: How to pass variables to qmake project file when qmake is run
body: <p>I need to dynamically change my e.g. application name and subsequent defines when calling <code>qmake</code> on my project file.</p>
  
  <p>An <strong>example</strong> would be:</p>
  
  <pre><code>include(version.pri)
  
  QT       += core gui network concurrent
  
  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  FLAVOR = ?
  
  TARGET = ../bin/$$FLAVOR
  TEMPLATE = app
  
  message("Application name: $$APP_NAME")
  
  !defined(APP_NAME) {
      APP_NAME = $$FLAVOR
  }
  
  !defined(APP_ORG) {
      APP_ORG = myorg
  }
  
  //...
  
  message("Application name 2: $$APP_NAME")
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <pre><code>Application name:
  Application name 2: ?
  </code></pre>
  
  <p>Above is an extract from my project file.</p>
  
  <hr>
  
  <p><strong>Documentation:</strong></p>
  
  <p>According to Qmake <a href="http://doc.qt.io/qt-5/qmake-test-function-reference.html#defined-name-type" rel="nofollow noreferrer">documenation</a>, I should be able to do the following:</p>
  
  <pre><code>FLAVOR = xyz
  
  !defined(APP_NAME) {
      APP_NAME = $$FLAVOR
  }
  </code></pre>
  
  <p><em>Purpose of above code:</em></p>
  
  <p><em>Check if APP_NAME is defined (anywhere, even passed as <code>qmake</code> parameter). If it is NOT defined, then set <code>APP_NAME</code> equal to <code>FLAVOR</code> which contains xyz</em></p>
  
  <p><strong>I have tried:</strong></p>
  
  <ul>
  <li><code>qmake -config debug "DEFINES += APP_NAME = myappname"</code></li>
  <li><code>qmake -config debug "APP_NAME = myappname"</code></li>
  <li><code>qmake -config debug APP_NAME = myappname</code></li>
  </ul>
  
  <p>of which none work.</p>
  
  <p><strong>How can I pass a definition to qmake which will set a variable in the Makefile i.e. <code>APP_NAME</code> as shown in the above example?</strong></p>
  
  <p><strong>please note</strong>: <em>some answers suggest of an issue with the question title. I have since edited the title to a more appropriate summary of my question and what I hope to achieve</em></p>