title: How to deploy a Qt application on Mac OS X using macdeployqt?
body: <p>I am having problems packaging my Qt app for Mac OS X using macdeployqt.</p>
  
  <p>On my Mac, I have Qt5 installed on ~/Qt5.1.0/5.1.0/clang_64 (this is where the bin/ and lib/ folder resides)</p>
  
  <p>I have a Qt application called "renamer" on ~/Documents/QtProjects/renamer/.</p>
  
  <p>Using Qt Creator, I have built the release version of my application on ~/Documents/QtProjects/build-renamer-Desktop_Qt_5_1_0_clang_64bit-Release.
  So the first thing I did was run <code>otool</code> on my application:</p>
  
  <pre><code>$ cd ~/Documents/QtProjects/build-renamer-Desktop_Qt_5_1_0_clang_64bit-Release
  $ otool -L renamer.app/Contents/MacOS/renamer
  renamer.app/Contents/MacOS/renamer:
      /Users/paul/Qt5.1.0//5.1.0/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.1.0, current version 5.1.0)
      /Users/paul/Qt5.1.0//5.1.0/clang_64/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.1.0, current version 5.1.0)
      /Users/paul/Qt5.1.0//5.1.0/clang_64/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.1.0, current version 5.1.0)
      /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
      /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
      /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
      /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
  </code></pre>
  
  <p>I have manually corrected the broken paths using <code>install_name_tool</code>:</p>
  
  <pre><code>$ cd ~/Documents/QtProjects/build-renamer-Desktop_Qt_5_1_0_clang_64bit-Release
  $ install_name_tool -change /Users/paul/Qt5.1.0//5.1.0/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets /Users/paul/Qt5.1.0/5.1.0/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets renamer.app/Contents/MacOS/renamer
  $ install_name_tool -change /Users/paul/Qt5.1.0//5.1.0/clang_64/lib/QtGui.framework/Versions/5/QtGui /Users/paul/Qt5.1.0/5.1.0/clang_64/lib/QtGui.framework/Versions/5/QtGui renamer.app/Contents/MacOS/renamer
  $ install_name_tool -change /Users/paul/Qt5.1.0//5.1.0/clang_64/lib/QtCore.framework/Versions/5/QtCore  /Users/paul/Qt5.1.0/5.1.0/clang_64/lib/QtCore.framework/Versions/5/QtCore renamer.app/Contents/MacOS/renamer
  $ otool -L renamer.app/Contents/MacOS/renamer
  renamer.app/Contents/MacOS/renamer:
      /Users/paul/Qt5.1.0/5.1.0/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.1.0, current version 5.1.0)
      /Users/paul/Qt5.1.0/5.1.0/clang_64/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.1.0, current version 5.1.0)
      /Users/paul/Qt5.1.0/5.1.0/clang_64/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.1.0, current version 5.1.0)
      /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
      /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
      /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
      /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
  </code></pre>
  
  <p>I have added /bin to my PATH and then called <code>macdeployqt</code> from my project directory.</p>
  
  <pre><code>$ cd ~/Documents/QtProjects/build-renamer-Desktop_Qt_5_1_0_clang_64bit-Release
  $ sudo macdeployqt renamer.app
  $ otool -L renamer.app/Contents/MacOS/renamer
  renamer.app/Contents/MacOS/renamer:
      @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.1.0, current version 5.1.0)
      @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.1.0, current version 5.1.0)
      @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.1.0, current version 5.1.0)
      /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
      /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
      /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
      /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
  </code></pre>
  
  <p>However, when I rename/remove the installed Qt libraries and run the application, I get an error indicating that the Qt libraries cannot be found within my app bundle. Any suggestions?</p>