Qt/qglobal.h Obsolete?

When I try to configure ROOT with --with-qt-incdir=/A/Path/include, the config finds Qt/qglobal.h. It then searches for a QT version, and returns

As far as I can tell, the problem comes when the configure searches /A/Path/include/Qt/qglobal.h for the string
"#define QT_VERSION_STR". But Qt/qglobal.h contains only a macro warning that this file (and all files in Qt/) are now obsolete, and

The file QtCore/qglobal.h does contain the string “#define QT_VERSION_STR”, but since this file is not searched by the configure script, ROOT is not compiled with qt support.

I dont know what version of qt4-mac the ‘Qt/’ directory became obsolete in.

I have a workaround for this:

I have inserted the following lines at line 3222 of the configure file.

        qtverneed="4.3.0"
        qttoonew="5.0.0"
        qttestdir=$qtmainincdir/../src/corelib/global
       if test ! -d $qttestdir ; then                     #NEW
            qttestdir=$qtmainincdir/QtCore                #NEW
        fi                                                #NEW
        if test ! -d $qttestdir ; then
            qttestdir=$qtmainincdir/Qt
        fi

This worked for me, since it gives preference to the QtCore dir. The compile succeeds, but drops the warnings

/A/path/include//Qt/qlineedit.h:3:10: warning: "Inclusion of header files
      from include/Qt is deprecated." [-W#warnings]
        #warning "Inclusion of header files from include/Qt is deprecated."

I can not test the configure file for other versions of qt. Anyway, this fix will only work so long as qt4-mac keeps the (now obsolete) ‘Qt/’ directory. If they decide to delete it, the configure will succeed, but the compile will fail.

OS: OSX 10.8.4
ROOT version: 5.34/02
Qt Version: 4.8.4 (Installed via macports qt4-mac@4.8.4_6).

Yes, you are correct.
The reliable way to check whether the Qt is present and its version is to invoke “qmake -v” command or /and “${QTDIR}/qmake -v”

This is supported by all Qt versions including the Qt5 and for all Qt platforms. For the pre-installed version of Qt the “qmake” is expected to be on PATH.