title: qmake Projects and Mac OS X SDKs
body: <p>What is the most sensible way to use Mac OS SDKs from a Qt project? You need to have a path to the base SDK (MacOSX10.X.sdk), paths to the headers you need, and to indicate the frameworks you are using.</p>
  
  <p>At the moment I am doing this in my pro file (with help from here; <a href="http://www.agile-workers.com/web/2012/03/qt-qmake-osx_sdk-xcode/" rel="nofollow">Qt, Qmake and Mac Os X SDKs</a>):</p>
  
  <pre><code>MAC_SDK  = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
  if( !exists( $$MAC_SDK) ) {
    error("The selected Mac OSX SDK does not exist at $$MAC_SDK!")
  }
  QMAKE_MAC_SDK = $$MAC_SDK
  
  INCLUDEPATH += $$QMAKE_MAC_SDK/System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers
  
  DEPENDPATH  += $$QMAKE_MAC_SDK/System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers
  
  LIBS += -framework CoreFoundation
  </code></pre>
  
  <p>The SDKs are in the Xcode app bundle, what the hell? I was wondering if there is an environment variable which stores the path to the SDKs. Also, switching SDK versions, I have to go the the MAC_SDK path and change 10.7 to something else, is that the best way?</p>