add the below line to the cmake file: include_directories ( BEFORE /usr/local/opt/qt5/include ) http://blog.glehmann.net/2015/01/06/Investigating-build-failure-with-both-Qt4-and-Qt5-installed-on-Mac-OS-X /
artilla's personal blog. Sorry for broken English, just in practice