昨日、私は MacOSX アプリケーションの展開についてたくさん読んでいましたが、まだいくつか疑問があります。過去数年間、 macdeployqtを使用して MacOSX 用の Qt4 アプリケーションをデプロイしてきました。現在、mi アプリケーションは、Qt フレームワークに属していないライブラリである Poppler を使用しています。
Homebrewを使用して poppler-qt4 をインストールしました:
brew install poppler --with-qt4 --enable-xpdf-headers
macdeployqtを使用した後、 install_name_toolを使用して絶対パスを相対パスで変更する必要があることがわかりました。一部の dylib には依存関係もあります。
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
macdeployqtを使用した後、Qt フレームワークがアプリ バンドル内にコピーされていることを知りました。
自作の dylib は -headerpad_max_install_names を使用してコンパイルされていますか?
brew を使用してこれを自動的に行う方法はありますか?
install_name_toolでは何を使用すればよいですか? @executable_path または @loader_path?
編集: macdeployqt は、サード パーティの dylibs、poppler-qt4、およびそのすべての依存関係を Applicaciont.app/Frameworks フォルダーにコピーし、install_name_tool が自動的に使用されるようにデプロイするのに十分スマートであるようです。しかし、今、私はこのバグに苦しんでいます: macdeployqt がプラグインをコピーしない問題は、poppler-qt4.4 の名前の「qt」にあると思います。