This project provide a CMake macro to help you deploy Qt application on MacOS. It will generate a deploy target that creates a .dmg for your .app bundle.
macdeployqt
to deploy frameworks and qml. Documentation is available here.
This project is conceptually based on the great Olivier Le Doeuff.
All you have to do is to call the add_qt_macos_dmg
macro to create a new target that will create the MacOS Deployment Targets.
IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
add_executable(MyApp MACOSX_BUNDLE ${MYAPP_SRCS})
FetchContent_Declare(
QtWindowsCMake
GIT_REPOSITORY "https://github.com/ahmedyarub/QtMacosCMake"
GIT_TAG master
)
FetchContent_MakeAvailable(QtMacosCMake)
add_qt_macos_dmg(MyApp)
ENDIF()
The you can simply run
make MyAppDeploy
Of course, add_qt_macos_dmg
accepts more options, see below for the detail.
add_qt_macos_dmg(my_app
NAME "MyApp"
QML_DIR "path/to/qmldir"
NO_PLUGINS
NO_STRIP
OVERWRITE_EXISTING
VERBOSE_LEVEL_DEPLOY 1
ALL
)
Here is the full list of possible arguments:
- Ahmed Yarub Hani Al Nuaimi: ahmedyarub@yahoo.com