make qtAddLibrary() a noisy compat wrapper for qtAddModule()

it's used by people (in particular, qt creator), so it would be not nice
to just delete it entirely.

Change-Id: I6bd849d00ebfe3b9b126e01a6d1c6e7c6584d8ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
This commit is contained in:
Oswald Buddenhagen 2012-03-01 18:49:29 +01:00
parent c4eed770be
commit 84fb7be6c1

View File

@ -22,53 +22,17 @@ defineReplace(qtLibraryTarget) {
}
defineTest(qtAddLibrary) {
INCLUDEPATH -= $$QMAKE_INCDIR_QT/$$1
INCLUDEPATH = $$QMAKE_INCDIR_QT/$$1 $$INCLUDEPATH
warning("qtAddLibrary() is deprecated. Use qtAddModule() or QT+= instead.")
LIB_NAME = $$1
unset(LINKAGE)
mac {
CONFIG(qt_framework, qt_framework|qt_no_framework) { #forced
QMAKE_FRAMEWORKPATH *= $${QMAKE_LIBDIR_QT}
FRAMEWORK_INCLUDE = $$QMAKE_LIBDIR_QT/$${LIB_NAME}.framework/Headers
!qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
INCLUDEPATH -= $$FRAMEWORK_INCLUDE
INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH
}
LINKAGE = -framework $${LIB_NAME}$${QT_LIBINFIX}
} else:!qt_no_framework { #detection
for(frmwrk_dir, $$list($$QMAKE_LIBDIR_QT $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH) /Library/Frameworks)) {
exists($${frmwrk_dir}/$${LIB_NAME}.framework) {
QMAKE_FRAMEWORKPATH *= $${frmwrk_dir}
FRAMEWORK_INCLUDE = $$frmwrk_dir/$${LIB_NAME}.framework/Headers
!qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
INCLUDEPATH -= $$FRAMEWORK_INCLUDE
INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH
}
LINKAGE = -framework $${LIB_NAME}
break()
}
}
}
# 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,
qtAddModule($$var):return(true):break()
return(false):break() # Yes, the break is insanity. But necessary.
}
}
isEmpty(LINKAGE) {
if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
win32:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}d
mac:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}_debug
}
isEmpty(LINKAGE):LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}
}
!isEmpty(QMAKE_LSB) {
QMAKE_LFLAGS *= --lsb-libpath=$$$$QMAKE_LIBDIR_QT
QMAKE_LFLAGS *= -L/opt/lsb/lib
QMAKE_LFLAGS *= --lsb-shared-libs=$${LIB_NAME}$${QT_LIBINFIX}
}
LIBS += $$LINKAGE
export(LIBS)
export(INCLUDEPATH)
export(QMAKE_FRAMEWORKPATH)
export(QMAKE_LFLAGS)
return(true)
error("No module matching library '$$1' found.")
}
defineTest(qtAddModule) {