diff options
authorMartin Afanasjew <>2015-09-27 14:39:06 +0200
committerOswald Buddenhagen <>2015-09-28 13:10:42 +0000
commit3964b683f849baade1576ea2f50aab631970df58 (patch)
parentd24366a63281543e6c1a8e6b615ce882ea6259ab (diff)
qmake: Fix 'Libs:' line in .pc files on OS X
On OS X with a framework-based build of Qt, the 'Libs:' line of the .pc files generated by `qmake` references the framework. This requires two separate arguments to the linker: The fixed string '-framework' and the name of the framework (e.g. 'QtCore'). Only the latter might need quoting. Prior to this fix, they were treated as a single argument (e.g. '-framework QtCore'), thus always quoted because of the contained space, and later lead to errors when trying to link a Qt framework discovered via `pkg-config`. Change-Id: I5c11ee651048832007e2ee4ebcbcf2e3212c8f48 Task-number: QTBUG-47162 Reviewed-by: Oswald Buddenhagen <>
1 files changed, 2 insertions, 1 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 4a03fafd77..7d4026c292 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3253,7 +3253,8 @@ MakefileGenerator::writePkgConfigFile()
int suffix = bundle.lastIndexOf(".framework");
if (suffix != -1)
bundle = bundle.left(suffix);
- pkgConfiglibName = "-framework " + bundle + " ";
+ t << "-framework ";
+ pkgConfiglibName = bundle.toQString();
} else {
if (!project->values("QMAKE_DEFAULT_LIBDIRS").contains(libDir))
t << "-L${libdir} ";