C++/Qt5 starter project with cmake build system, QtQuick, QtWidgets, AppIcon, macOS bundle and macdeployqt support.
Clone the repository.
Add the bin path of your Qt installation to your
# there should be an entry like this: export PATH="$PATH:~/sourcecode/sdk/QtLatest/5.12.0/clang_64/bin"
- Add the bin path of your CMake installation to your
# there should be an entry like this: export PATH="$PATH:/Applications/CMake.app/Contents/bin"
If you want to make a QtQuick app use the
quick_appfolder. For a QtWidgets app use the
CMakeLists.txtfile and set the
CMAKE_PREFIX_PATHvariable to your Qt bin path as described in 2.
Build a debug version
./build.sh in your app root directory. It will create a
build directory and compile the app. On every run the script removes the build directory entirely. To prevent this, go to the build directory and run
Build a release version and deploy
- Check that the program
macdeployqtis within your PATH variable.
$ which macdeployqt $ ~/sourcecode/sdk/QtLatest/5.12.0/clang_64/bin/macdeployqt
In the folder
res/there is a file
AppIcon.png. Replace these files with your AppIcon.
CMakeLists.txton line 26 and following set the variables to your needs.
./build.shin your app root directory but with parameter
$ ./build.sh release
When finished there is a bundle
AppName.app in the build folder ready to ship.
Tested with the following environment:
- macOS Mojave 10.14.3
- Sublime Text 3
- Qt 5.12 clang_64
- CMake 3.13.3