title: dylibs and frameworks in bundle app
body: <p>Yesterday I was reading a lot about deploying MacOSX applications, but I still have some doubts. I have been deploying Qt4 applications for MacOSX for the past few years using <em>macdeployqt</em>. Now, mi application uses a library that doesn't belong to the Qt framework: Poppler.</p>
  
  <p>I have installed poppler-qt4 using <em>Homebrew</em> : </p>
  
  <pre><code>brew install poppler --with-qt4 --enable-xpdf-headers
  </code></pre>
  
  <p>After using <em>macdeployqt</em>, I know that I have to use <em>install_name_tool</em> to change the absolute paths by relative paths. Some of the dylibs have also dependencies:</p>
  
  <blockquote>
  <pre><code>MyApp.app/Contents/MacOS/MyApp:
      /usr/local/lib/libpoppler-qt4.4.dylib
  
  /usr/local/lib/libpoppler-qt4.4.dylib:
    /usr/local/Cellar/poppler/0.20.5/lib/libpoppler.28.dylib
    /usr/local/lib/libfontconfig.1.dylib
    /usr/local/lib/QtCore.framework/Versions/4/QtCore
    /usr/local/lib/QtGui.framework/Versions/4/QtGui
    /usr/local/lib/QtXml.framework/Versions/4/QtXml
  </code></pre>
  </blockquote>
  
  <p>After using <em>macdeployqt</em> I know that Qt frameworks have been copied inside the app bundle, How can I change <em>/usr/local/lib/QtCore.framework/Versions/4/QtCore</em> with a relative path using <em>install_name_tool</em>?</p>
  
  <p>Are homebrew dylibs compiled using <em>-headerpad_max_install_names</em>?</p>
  
  <p>Is there an automatic way to do this using brew?</p>
  
  <p>What should I use with <em>install_name_tool</em>? @executable_path or @loader_path?</p>
  
  <p>EDIT: It seems that macdeployqt is smart enough to deploy third party dylibs, poppler-qt4 and all its dependencies are copied to the Applicaciont.app/Frameworks folder, and install_name_tool is used automatically. BUT, now I am suffering this BUG : <a href="https://stackoverflow.com/questions/3454001/macdeployqt-not-copying-plugins">macdeployqt not copying plugins</a> I suppose that the problem is "qt" on the name of poppler-qt4.4.</p>