Mac deployment not very easy but maybe a solution
I've got a problem with deploying my Qt/c++ app on macos but maybe i solved it... don't really know as i don't have a clean mac os to test.
My app works well with Qt creator.
Here's what i did :
i ran macdeployqt on the .app folder created by QTCreator
This tool claimed that /Users/(...)/clang_64/Frameworks/(...)/QtWidgets was missing
and i had the same msg for all essential Qt libs.
after a little find command i found at that my files were in /Users/(...)/clang_64/Lib/(...)/QtWidgets
and that i had no "Frameworks" directory in /Users/(...)/clang_64.
So i made a "ln -s /Users/(...)/clang_64/Lib /Users/(...)/clang_64/Frameworks
seems it did the trick as rerunin macdeployqt on a fresh created .app folder was apparently working (no error message).
But now then i tried to run my app directly from the finder it does nothing and by launching it in the terminal i get an error message claiming that "This application failed to start cause it can't find or load the Qt platform plugin cocoa"
i added a platforms directory in the Content folder of my .app folder and copied libcocoa.dylib in it
Now i'm able to launch the binary directly from terminal; but i'm wondering if it will run on another mac...
just to clarrify as now i'm able to create a working dmg file (i still don't know how it will act on a non developer mac...)
here are the steps i followed
Build release with QtCreator
ln -s /Users/(….)/clang_64/Lib /Users/(…)/clang_64/Frameworks (do that only once it's permanent)
create a "platforms" folder in yourApplication.app/Content/MacOS directory and put libqcocoa.dylib (found in <QtDir>/clang_64/platforms) in it.
macdeployqt yourApplication.app -dmg
And you have a portable (i hope) dmg file
i'll let u know as soon as i try on a nude OS
Hi, you can test by moving your Qt installation somewhere else temporarily, or just rename the Qt directory. Then try to run your app from the finder.
It's a cheap way of simulating running on another Mac :-)
oh really ? Cool ! That's the sandbox effect i guess, u're right. as the app should not try to search for system lib right ?
I tried to copy my dmg file anywhere and still working :)))
so i guess it's ok. Just gotta learn to create a deb and a rpm and my project will run almost everywhere (as i already created the windows installer with innosetup)
That's a lot of work for deployment.. I'm really wondering if i should not use Qt Installer framework.. On the other hand linux and mac users would prefer a native installer... cruel dilemma
IN CASE SOMEONE READS THIS :
in fact, 'spite the dmg format the binary file in it was referencing /Users/[MyUsername]/Qt/5.2/clang_64/....Qtwidgets and every other lib so moving dmg file on disk is not a good solution. I found out by trying to install on a fresh copy of mac OS (which is finally really simple to obtain I intialy dual booting macOS with another macos would be hard but it's very easy ^^)
whatever seems i have to use a tool named install_tool_name find out that in the doc ^^.
should have start from there i guess but experimenting is always fun and a more effective to learn deeply :p