source: branches/vendor/trolltech/qt/current/mkspecs/features/qt_functions.prf @ 2

Last change on this file since 2 was 2, checked in by Dmitry A. Kuminov, 12 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 2.3 KB
Line 
1defineReplace(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
18defineTest(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    isEmpty(LINKAGE) {
49       CONFIG(debug, debug|release) {
50           win32:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}d
51           mac:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}_debug
52       }
53       isEmpty(LINKAGE):LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}
54    }
55    !isEmpty(QMAKE_LSB) {
56        QMAKE_LFLAGS *= --lsb-libpath=$$$$QMAKE_LIBDIR_QT
57        QMAKE_LFLAGS *= -L/opt/lsb/lib
58        QMAKE_LFLAGS *= --lsb-shared-libs=$${LIB_NAME}$${QT_LIBINFIX}
59    }
60    LIBS += $$LINKAGE
61    export(LIBS)
62    export(INCLUDEPATH)
63    export(QMAKE_FRAMEWORKPATH)
64    export(QMAKE_LFLAGS)
65    return(true)
66}
Note: See TracBrowser for help on using the repository browser.