Commit 3f4517f6 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Qt: Detect Qt versions build with libinfix

parent 66896e19
...@@ -1582,20 +1582,24 @@ QString QtVersion::resolveLink(const QString &path) const ...@@ -1582,20 +1582,24 @@ QString QtVersion::resolveLink(const QString &path) const
QString QtVersion::qtCorePath() const QString QtVersion::qtCorePath() const
{ {
QString path = libraryInstallPath(); QDir libDir(libraryInstallPath());
QFileInfoList infoList = libDir.entryInfoList();
QStringList toTest; foreach (const QFileInfo &info, infoList) {
toTest << path + QLatin1String("/libQtCore.so.") + qtVersionString(); const QString file = info.fileName();
toTest << path + QLatin1String("/libQtCore.so"); if (info.isDir()
toTest << path + QLatin1String("/QtCore.dll"); && file.startsWith(QLatin1String("QtCore"))
toTest << path + QLatin1String("/QtCored.dll"); && file.endsWith(QLatin1String(".framework"))) {
toTest << path + QLatin1String("/QtCore4.dll"); // handle Framework
toTest << path + QLatin1String("/QtCored4.dll"); const QString libName = file.left(file.lastIndexOf('.'));
toTest << path + QLatin1String("/QtCore.framework/QtCore"); return libDir.absoluteFilePath(file + '/' + libName);
}
foreach (const QString &path, toTest) { if (info.isReadable()
if (QFileInfo(path).exists()) && (file.startsWith(QLatin1String("libQtCore"))
return path; || file.startsWith(QLatin1String("QtCore")))
&& (file.endsWith(QLatin1String(".dll"))
|| file.endsWith(QString::fromLatin1(".so.") + qtVersionString()))) {
return info.absoluteFilePath();
}
} }
return QString(); return QString();
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment