Skip to content

Example project for using meson to build MacOS app bundle, with Qt framework.

Notifications You must be signed in to change notification settings

kdart/qt-meson-example

Repository files navigation

Qt Application bundle for MacOS using meson+ninja

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.

Dependencies

Homebrew

Building also depends on homebrew. I install everything in /opt.

Qt

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.

Download: http://mirrors.ocf.berkeley.edu/qt/archive/qt/5.9/5.9.6/single/qt-everywhere-opensource-src-5.9.6.tar.xz

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

Setup

  1. Install the build tools.
   brew install ninja
   brew install meson
  1. 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
  1. Run configure. The configure script runs meson for you.
   ./configure

Build and install

  1. cd into build directory.
   cd build
  1. run ninja.
   ninja
  1. run ninja install to install app bundle under install subdirectory.
   ninja install

Run

cd ../install
open hello\_world.app

About

Example project for using meson to build MacOS app bundle, with Qt framework.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published