Qt5 on FreeBSD

For a reason FreeBSD doesn’t support Qt5 build tools out of box. There are a few problems that have to be solved before you can run qmake && make to build a project. Firstly, my default setup didn’t have QMAKESPEC specified, add this line to your .bashrc/.zshrc:

export QMAKESPEC=freebsd-g++

Also add this line to specify Qt5 theme:


If you installed qt with qt5-core and qt5-qmake, the installed packages are in:


but this path is not in standard $PATH, so you need to append it: