Commit abf84c32 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Qt: Handle absolute paths to mkspecs

Handle absolute paths to mkspec and do not accept any directory
as a mkspec: Only accept directories containing a qmake.conf.

Task-number: QTCREATORBUG-17237
Change-Id: I18c2b28a0abc525721df7c4f1ac2d272ca4cadb1
Reviewed-by: Oswald Buddenhagen's avatarOswald Buddenhagen <>
Reviewed-by: Tim Jenssen's avatarTim Jenssen <>
parent a7f237d1
......@@ -1082,13 +1082,19 @@ FileName BaseQtVersion::mkspecPath() const
bool BaseQtVersion::hasMkspec(const FileName &spec) const
QFileInfo fi;
+ QLatin1String("/mkspecs/") + spec.toString());
if (fi.isDir())
if (spec.isEmpty())
return true; // default spec of a Qt version
QDir mkspecDir = QDir(QDir::fromNativeSeparators(qmakeProperty("QT_HOST_DATA"))
+ QLatin1String("/mkspecs/"));
const QString absSpec = mkspecDir.absoluteFilePath(spec.toString());
if (QFileInfo(absSpec).isDir() && QFileInfo(absSpec + "/qmake.conf").isFile())
return true;
fi.setFile(sourcePath().toString() + QLatin1String("/mkspecs/") + spec.toString());
return fi.isDir();
mkspecDir.setPath(sourcePath().toString() + QLatin1String("/mkspecs/"));
const QString absSrcSpec = mkspecDir.absoluteFilePath(spec.toString());
return absSrcSpec != absSpec
&& QFileInfo(absSrcSpec).isDir()
&& QFileInfo(absSrcSpec + "/qmake.conf").isFile();
BaseQtVersion::QmakeBuildConfigs BaseQtVersion::defaultBuildConfig() const
Markdown is supported
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