How to detect if Qt is OpenGL or Angle version in qmake project?

1.2k Views Asked by At

I want to detect if the Qt version is using OpenGL or Angle on Windows, for puposes of having nmake install working correctly. This is what I have now, snippet from a .pro file:

GLTMP = $$[QT_HOST_PREFIX]
contains(GLTMP, ".*_opengl") {
    message(Detected OpenGL)
} else {
    message(Did not detect OpenGL so assuming Angle)
    # add Angle DLL files to INSTALLS
}

Now this only works if QT_HOST_PREFIX actually contains _opengl for OpenGL version, but not for Angle version (for example C:\Qt\5.2.1\msvc2010_opengl vs. C:\Qt\5.2.1\msvc2010_opengl), but obviously this is not very robust.

Is there a way, which does not depend on path strings?

Desired result is to have Qmake produce correct makefile, so nmake install does the right thing.

1

There are 1 best solutions below

0
Olli On BEST ANSWER

contains(QT_CONFIG, angle) should give you the proper result.

I know it's been a while since the question was asked but I stumbled over this page when looking for exactly that thing and thought that I might help others that have the same problem :)