make use of QT_MODULES to simplify code

Change-Id: I1124088f807023faf678e030cfb1fc4a4c8b40d7
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-06-17 12:18:36 +02:00 committed by The Qt Project
parent 65b749f5ea
commit 7d4980f3ee

View File

@ -26,9 +26,8 @@ defineTest(qtAddLibrary) {
warning("qtAddLibrary() is deprecated. Use qtAddModule() or QT+= instead.")
# Reverse-engineer the module name from the library name.
for(var, $$list($$find($$list($$enumerate_vars()), ^QT\\.[^.]+\\.name$))) {
isEqual($$var, $$1) {
var ~= s,^QT\\.([^.]+)\\.name$,\\1,
for(var, QT_MODULES) {
isEqual(QT.$${var}.name, $$1) {
qtAddModule($$var, , LIBS):return(true):break()
return(false):break() # Yes, the break is insanity. But necessary.
}