Qt Mac Deployment

Adding QT Framework to my .app package

Im after the documentation on the Qt website in the "Deployment" section. I created an application called HTTPClient.app

I created the Framework folder in the “Content” section and copied crypto ++ and qscintilla and Qt and looks like this:

enter image description here

then I ran install_name_tool -id -change

DylibFile=libqscintilla2.11.dylib
install_name_tool -id @executable_path/../Frameworks/$DylibFile  $ProjectName.app/Contents/Frameworks/$DylibFile
install_name_tool -change $DylibFile @executable_path/../Frameworks/$DylibFile $ProjectName.app/Contents/MacOS/$ProjectName

and the same for crypto ++. I did the following for Qt Frameworks

DylibFile=QtCore.framework/Versions/5/QtCore
install_name_tool -id @executable_path/../Frameworks/$DylibFile  $ProjectName.app/Contents/Frameworks/$DylibFile
install_name_tool -change $DylibFile @executable_path/../Frameworks/$DylibFile $ProjectName.app/Contents/MacOS/$ProjectName

DylibFile=QtWidgets.framework/Versions/5/QtWidgets
install_name_tool -id @executable_path/../Frameworks/$DylibFile  $ProjectName.app/Contents/Frameworks/$DylibFile
install_name_tool -change $DylibFile @executable_path/../Frameworks/$DylibFile $ProjectName.app/Contents/MacOS/$ProjectName

DylibFile=QtGui.framework/Versions/5/QtGui
install_name_tool -id @executable_path/../Frameworks/$DylibFile  $ProjectName.app/Contents/Frameworks/$DylibFile
install_name_tool -change $DylibFile @executable_path/../Frameworks/$DylibFile $ProjectName.app/Contents/MacOS/$ProjectName


DylibFile=QtSql.framework/Versions/5/QtSql
install_name_tool -id @executable_path/../Frameworks/$DylibFile  $ProjectName.app/Contents/Frameworks/$DylibFile
install_name_tool -change $DylibFile @executable_path/../Frameworks/$DylibFile $ProjectName.app/Contents/MacOS/$ProjectName

DylibFile=QtNetwork.framework/Versions/5/QtNetwork
install_name_tool -id @executable_path/../Frameworks/$DylibFile  $ProjectName.app/Contents/Frameworks/$DylibFile
install_name_tool -change $DylibFile @executable_path/../Frameworks/$DylibFile $ProjectName.app/Contents/MacOS/$ProjectName

Now when I run otool, I get the following:

enter image description here

I get the path of crypto and qscintilla, but should the Qt framework not follow the same pattern? It still points to the starting path.

+4
source share
1 answer

, , install_name_tool Qt Frameworks macdeployqt, bin Qt.

Qt . , Qt bin , , , : -

macdeployqt HTTPClient.app

, Qt Framework, .

+7

Source: https://habr.com/ru/post/1546217/


All Articles