summaryrefslogtreecommitdiffstats
path: root/qmake/generators/makefile.cpp
diff options
context:
space:
mode:
authorMatt Fischer <matt.fischer@garmin.com>2013-02-18 11:29:45 -0600
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-20 12:59:55 +0100
commitfcef9b42520c55f6482e4a6c86bd55246a85e88b (patch)
treeb534a84150e219d7499838410640c690055e29c8 /qmake/generators/makefile.cpp
parent75087198306d615c7df1fb3763c5027834f0b99c (diff)
Fix generated pkg-config files when cross-compiling
The Libs: line of the pkg-config files is constructed by taking the name of the .pc file itself, and stripping off the path and extension. However, the code which does this does not handle path separators correctly when the target OS and local OS are different. To get around this, the custom string manipulation was replaced with a call to QFileInfo::completeBaseName(), which can handle the different path separators correctly. Task-number: QTBUG-29700 Change-Id: Ia817b415d303b249f56fcc3d1f073cae99c43046 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'qmake/generators/makefile.cpp')
-rw-r--r--qmake/generators/makefile.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index b001fd930b..55c819657a 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3158,11 +3158,8 @@ MakefileGenerator::pkgConfigFixPath(QString path) const
void
MakefileGenerator::writePkgConfigFile()
{
- QString fname = pkgConfigFileName(), lname = fname;
+ QString fname = pkgConfigFileName();
mkdir(fileInfo(fname).path());
- int slsh = lname.lastIndexOf(Option::dir_sep);
- if(slsh != -1)
- lname = lname.right(lname.length() - slsh - 1);
QFile ft(fname);
if(!ft.open(QIODevice::WriteOnly))
return;
@@ -3249,7 +3246,7 @@ MakefileGenerator::writePkgConfigFile()
pkgConfiglibName = "-framework " + bundle + " ";
} else {
pkgConfiglibDir = "-L${libdir}";
- pkgConfiglibName = "-l" + lname.left(lname.length()-Option::libtool_ext.length());
+ pkgConfiglibName = "-l" + fileInfo(fname).completeBaseName();
if (project->isActiveConfig("shared"))
pkgConfiglibName += project->first("TARGET_VERSION_EXT").toQString();
}