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.
-
Did you create a command line application ?
-
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. -
Sorry, I misread that.
Can you share your cmake file ?
-
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:set(CMAKE_MACOSX_BUNDLE ON)
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 terminalpathToQt/5.15.2/clang_64/bin/macdeployqt
"
DO NOT PRESS ENTERAfter 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😅)