summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-09-16 08:47:33 +1000
committerQt by Nokia <qt-info@nokia.com>2011-09-17 01:32:51 +0200
commit81a5885814d9db2bf7968c749aeb9c6415784086 (patch)
tree51f9396bb9467e39259265b9cc83b3129c4d21a0 /mkspecs
parentfb59d866c25703f7c3c145f050a64c07600a3244 (diff)
Mac: fix linking with Qt frameworks which don't exist at qmake time
This restores the forced-vs-detection logic for Qt frameworks which was removed by commit ceed409b40fd5b8fe5c62ac33144e66f50b28ede. The problem of linking against Qt modules compiled as a static library is solved a different way: the module must explicitly state in the module .pri file that it is built as a static lib. Change-Id: Ie3d726f7b3933e5b5d27f15c6112ec1c7dee1ea2 Reviewed-on: http://codereview.qt-project.org/5034 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/qt_functions.prf17
1 files changed, 14 insertions, 3 deletions
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index cb04f94120..09b1b8a34b 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -96,6 +96,7 @@ defineTest(qtAddModule) {
MODULE_NAME = $$eval(QT.$${1}.name)
MODULE_INCLUDES = $$eval(QT.$${1}.includes)
MODULE_LIBS = $$eval(QT.$${1}.libs)
+ MODULE_CONFIG = $$eval(QT.$${1}.module_config)
CONFIG += $$eval(QT.$${1}.CONFIG)
DEFINES += $$eval(QT.$${1}.DEFINES)
@@ -115,8 +116,17 @@ defineTest(qtAddModule) {
unset(LINKAGE)
mac {
- for(frmwrk_dir, $$list($$MODULE_LIBS $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH) /Library/Frameworks)) {
- exists($${frmwrk_dir}/$${MODULE_NAME}.framework) {
+ !contains(MODULE_CONFIG,staticlib):CONFIG(qt_framework, qt_framework|qt_no_framework) { #forced
+ QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS}
+ FRAMEWORK_INCLUDE = $$MODULE_INCLUDES.framework/Headers
+ !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
+ INCLUDEPATH -= $$FRAMEWORK_INCLUDE
+ INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH
+ }
+ LINKAGE = -framework $${MODULE_NAME}$${QT_LIBINFIX}
+ } else:!qt_no_framework { #detection
+ for(frmwrk_dir, $$list($$MODULE_LIBS $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH) /Library/Frameworks)) {
+ exists($${frmwrk_dir}/$${MODULE_NAME}.framework) {
QMAKE_FRAMEWORKPATH *= $${frmwrk_dir}
FRAMEWORK_INCLUDE = $$frmwrk_dir/$${MODULE_NAME}.framework/Headers
!qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
@@ -125,7 +135,8 @@ defineTest(qtAddModule) {
}
LINKAGE = -framework $${MODULE_NAME}
break()
- }
+ }
+ }
}
}