Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Deploy application in macOS.
Hi everyone. Today I try to deploy my application with qt. I have no idea how to do this, because I'm using Cmake in my project. I already realise the project and have an exec file. But it doesn't work on other computer for more reason.
I google for about 2 hour to find information, but nothing. Of course I try macdeployqt, but it doesn't build with such problem: " :-1: error: Could not find feature macdeployqt.". And as i understand it work only with qmake. But I have Cmake proj.
Anybody have complete guide to solve this simple problem?
Hi and welcome to devnet,
The simple way is to call macdeployqt manually on the bundle you created.
The tool itself does not depend on qmake.
@SGaist, Ok in this folder I have my qt project release.
Here what I try to do with terminal
What I need to do?
Did you create a command line application ?
@SGaist Can you please clarify what you are talking about?
If you're talking about my app, no, it's a full GUI using QT.
If you're talking about macdeployqt, I didn't create it, it was already there.
@moVir provide the full path to the macdeployqt tool in the terminal
in case of a QML based application, do not forget to provide the path to your qml files via --qmldir
You seem to have only the executable created where you should have an application bundle.
Do you have CONFIG -= app_bundle in your .pro file ?
If so remove it. If not, then that is strange and you shall add CONFIG += app_bundle.
@SGaist Yea, here the main problem. I don't have .pro. Because I work with Cmake, not with Qmake, this what I mean here:
So I want to know, is it possible to create application bundle with CMake.
Sorry, I misread that.
Can you share your cmake file ?
Here u can find it.
You need to set the MACOSX_BUNDLE property on your application.
@SGaist Thank u! It's work!
For everybody who not understand:
U need add this to your CmakeList.txt:
After u need build your project in release with QT Creator (I hope u understand this step)
Next u can find folder (in folder of your project) with name like: "build_projName_Desktop_Qt_5_15_2_clang_64bit-Release"
And there u can find file with extension: " .app"
After open terminal and go to folder ONE STEP BEFORE ur Release folder.
Next u need to open Terminal and ATTENTION, as @J-Hilk said:
"provide the full path to the macdeployqt tool in the terminal
DO NOT PRESS ENTER
After u provide path to macdeployqt, press "Space" and write :" build_projName_Desktop_Qt_5_15_2_clang_64bit-Release/projname.app"
If u still not understand, here my example(only terminal part).
Good luck and thanks to @J-Hilk and @SGaist .
And my full proj: https://github.com/Geridok/StatisticsOfElectronicHoles
There we solve some interesting problem in physics. (If u understand Russian, special welcome😅)