mkspecs/features/qt_functions.prf
changeset 0 1918ee327afb
child 3 41300fa6a67c
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 defineReplace(qtLibraryTarget) {
       
     2    unset(LIBRARY_NAME)
       
     3    LIBRARY_NAME = $$1
       
     4    mac:!static:contains(QT_CONFIG, qt_framework) {
       
     5       QMAKE_FRAMEWORK_BUNDLE_NAME = $$LIBRARY_NAME
       
     6       export(QMAKE_FRAMEWORK_BUNDLE_NAME)
       
     7    }
       
     8    contains(TEMPLATE, .*lib):CONFIG(debug, debug|release) {
       
     9       !debug_and_release|build_pass {
       
    10           mac:RET = $$member(LIBRARY_NAME, 0)_debug
       
    11    	      else:win32:RET = $$member(LIBRARY_NAME, 0)d
       
    12       }
       
    13    }
       
    14    isEmpty(RET):RET = $$LIBRARY_NAME
       
    15    return($$RET)
       
    16 }
       
    17 
       
    18 defineTest(qtAddLibrary) {
       
    19     INCLUDEPATH -= $$QMAKE_INCDIR_QT/$$1
       
    20     INCLUDEPATH = $$QMAKE_INCDIR_QT/$$1 $$INCLUDEPATH
       
    21 
       
    22     LIB_NAME = $$1
       
    23     unset(LINKAGE)
       
    24     mac {
       
    25        CONFIG(qt_framework, qt_framework|qt_no_framework) { #forced
       
    26           QMAKE_FRAMEWORKPATH *= $${QMAKE_LIBDIR_QT}
       
    27           FRAMEWORK_INCLUDE = $$QMAKE_LIBDIR_QT/$${LIB_NAME}.framework/Headers
       
    28           !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
       
    29              INCLUDEPATH -= $$FRAMEWORK_INCLUDE
       
    30              INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH
       
    31            }
       
    32            LINKAGE = -framework $${LIB_NAME}$${QT_LIBINFIX}
       
    33         } else:!qt_no_framework { #detection
       
    34            for(frmwrk_dir, $$list($$QMAKE_LIBDIR_QT $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH) /Library/Frameworks)) {
       
    35        	      exists($${frmwrk_dir}/$${LIB_NAME}.framework) {
       
    36                 QMAKE_FRAMEWORKPATH *= $${frmwrk_dir}
       
    37     	        FRAMEWORK_INCLUDE = $$frmwrk_dir/$${LIB_NAME}.framework/Headers
       
    38     	        !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
       
    39     	          INCLUDEPATH -= $$FRAMEWORK_INCLUDE
       
    40     	          INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH
       
    41                 }
       
    42     	        LINKAGE = -framework $${LIB_NAME}
       
    43        	        break()
       
    44               }
       
    45            }
       
    46        }
       
    47     }
       
    48     symbian {
       
    49         isEqual(LIB_NAME, QtGui) {
       
    50             # Needed for #include <QtGui> because qs60mainapplication.h includes aknapp.h
       
    51             INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE
       
    52         }
       
    53         isEqual(LIB_NAME, QtWebKit) {
       
    54             # Needed for #include <QtXmlPatterns/QtXmlPatterns> because relative inclusion problem in toolchain
       
    55             INCLUDEPATH *= $$QMAKE_INCDIR_QT/QtXmlPatterns
       
    56         }
       
    57     }
       
    58     isEmpty(LINKAGE) {
       
    59        if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
       
    60            win32:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}d
       
    61            mac:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}_debug
       
    62        }
       
    63        isEmpty(LINKAGE):LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}
       
    64     }
       
    65     !isEmpty(QMAKE_LSB) {
       
    66         QMAKE_LFLAGS *= --lsb-libpath=$$$$QMAKE_LIBDIR_QT
       
    67         QMAKE_LFLAGS *= -L/opt/lsb/lib
       
    68         QMAKE_LFLAGS *= --lsb-shared-libs=$${LIB_NAME}$${QT_LIBINFIX}
       
    69     }
       
    70     LIBS += $$LINKAGE
       
    71     export(LIBS)
       
    72     export(INCLUDEPATH)
       
    73     export(QMAKE_FRAMEWORKPATH)
       
    74     export(QMAKE_LFLAGS)
       
    75     return(true)
       
    76 }