I am preparing a shell script to build my QtApp into a .app for OSX. I do the following in my script
qmake MyApp.pro -spec macx-clang CONFIG+=release CONFIG+=x86_64 CONFIG+=qml_debug
make
macdeployqt MyApp/MyApp.app
And I get the MyApp.app. Great until here! But when I double click open it, I get the following error:
You can’t open the application “MyApp.app” because it is not supported on this type of Mac.
I tried to search around this problem. Looks like I need to add some more lines of code in my script related to otool & install_name_tool as mentioned in the following official link from Qt:
http://doc.qt.io/qt-5/osx-deployment.html#macdeploy
Its fair explanation of which tools & what works below Qt to get the final .app, but I am not able to figure out what exactly to put in my script so that I get a MyApp.app statically linked with Qt libraries which runs on my osx machine after the build.
The Question:
Can someone please point out what to add in my script after the macdeployqt command to get a proper MyApp.app for OSX ?
Btw, running otool command on MyApp gives the following output:
otool -L MyApp.app/Contents/MacOS/MyApp
MyApp.app/Contents/MacOS/MyApp:
@rpath/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.6.0, current version 5.6.1)
@rpath/QtQml.framework/Versions/5/QtQml (compatibility version 5.6.0, current version 5.6.1)
@rpath/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.6.0, current version 5.6.1)
@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.6.0, current version 5.6.1)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.6.0, current version 5.6.1)
/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/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)