On Ubuntu 13.04: FindQt4.cmake gets confused when I have qt5 libraries installed (even if I have qt4 libraries installed also).
$ locate qglobal.h /usr/include/qt4/Qt/qglobal.h /usr/include/qt4/QtCore/qglobal.h /usr/include/qt5/QtCore/qglobal.h After I run $ sudo apt-get remove qtbase5-dev Q_WS_X11 is correctly set to on. FindQt4.cmake does not seem to use the QTDIR environment variable except when looking for qmake. Can the following be changed to look in QTDIR first? check_symbol_exists(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11) Note that I don't care much about resolving this. It's more I'm trying to understand how things work. I don't see why QTDIR is only respected for qmake (or maybe I'm wrong). Scott