Example project to build Qt app bundle for MacOS using meson.
This repository contains a simple Qt5 Hello World application for MacOS that is built with Meson and ninja build system.
Building also depends on homebrew. I install everything in /opt.
I currently install Qt from source, first. I would like to get Qt as part of the build using a subproject, but that's not fully set up yet.
Build like this:
DESIRED_QT=5.9.6
SRC=$PWD
cd ~/build
tar xJf ~/Downloads/qt-everywhere-opensource-src-${DESIRED_QT}.tar.xz
cd qt-everywhere-src-${DESIRED_QT}
./configure -prefix /opt/Qt${DESIRED_QT} -nomake tests -nomake examples -opensource -skip qt3d -c++std c++11
patch -p1 < $SRC/subprojects/qt-everywhere-opensource-src-${DESIRED_QT}.diff
make
sudo make install
- Install the build tools.
brew install ninja
brew install meson
- Make sure the Qt version's bin directory is on your PATH. For example: /opt/Qt5.9.5/bin (The configure script uses qmake to determine the Qt version)
export PATH=/opt/Qt5.9.5/bin:$PATH
- Run configure. The configure script runs meson for you.
./configure
- cd into build directory.
cd build
- run ninja.
ninja
- run ninja install to install app bundle under install subdirectory.
ninja install
cd ../install
open hello\_world.app