Commit 83d5461c authored by dt's avatar dt
Browse files

Fixes: Find the qplatformdefs.h file

Task:     -
RevBy:    -
AutoTest: -
Details:  Add the include path for qplatformdefs.h to the fot.
parent e503e1e4
......@@ -226,7 +226,7 @@ QStringList CMakeProject::files(FilesMode fileMode) const
void CMakeProject::saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &writer)
{
// TODO
Q_UNUSED(writer)
Q_UNUSED(writer);
}
void CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &reader)
......
......@@ -474,6 +474,9 @@ void Qt4Project::updateCodeModel()
}
}
// Add mkspec directory
allIncludePaths.append(qtVersion(activeBuildConfiguration())->mkspecPath());
QStringList files;
files += m_projectFiles->files[HeaderType];
files += m_projectFiles->generatedFiles[HeaderType];
......
......@@ -728,6 +728,12 @@ QString QtVersion::mkspec() const
return m_mkspec;
}
QString QtVersion::mkspecPath() const
{
updateMkSpec();
return m_mkspecFullPath;
}
QHash<QString,QString> QtVersion::versionInfo() const
{
updateVersionInfo();
......@@ -1023,24 +1029,24 @@ void QtVersion::updateMkSpec() const
//qDebug()<<"Finding mkspec for"<<path();
QString mkspec;
QFile f(path() + "/.qmake.cache");
if (f.exists() && f.open(QIODevice::ReadOnly)) {
while(!f.atEnd()) {
QByteArray line = f.readLine();
if(line.startsWith("QMAKESPEC")) {
const QList<QByteArray> &temp = line.split('=');
if(temp.size() == 2) {
mkspec = temp.at(1).trimmed();
if (mkspec.startsWith("$$QT_BUILD_TREE/mkspecs/"))
mkspec = mkspec.mid(QString("$$QT_BUILD_TREE/mkspecs/").length());
else if (mkspec.startsWith("$$QT_BUILD_TREE\\mkspecs\\"))
mkspec = mkspec.mid(QString("$$QT_BUILD_TREE\\mkspecs\\").length());
}
break;
}
}
f.close();
} else {
// QFile f(path() + "/.qmake.cache");
// if (f.exists() && f.open(QIODevice::ReadOnly)) {
// while(!f.atEnd()) {
// QByteArray line = f.readLine();
// if(line.startsWith("QMAKESPEC")) {
// const QList<QByteArray> &temp = line.split('=');
// if(temp.size() == 2) {
// mkspec = temp.at(1).trimmed();
// if (mkspec.startsWith("$$QT_BUILD_TREE/mkspecs/"))
// mkspec = mkspec.mid(QString("$$QT_BUILD_TREE/mkspecs/").length());
// else if (mkspec.startsWith("$$QT_BUILD_TREE\\mkspecs\\"))
// mkspec = mkspec.mid(QString("$$QT_BUILD_TREE\\mkspecs\\").length());
// }
// break;
// }
// }
// f.close();
// } else {
// no .qmake.cache so look at the default mkspec
QString mkspecPath = versionInfo().value("QMAKE_MKSPECS");
if (mkspecPath.isEmpty())
......@@ -1095,9 +1101,10 @@ void QtVersion::updateMkSpec() const
mkspec = f2.symLinkTarget();
}
#endif
}
// }
int index =mkspec.lastIndexOf('/');
m_mkspecFullPath = mkspec;
int index = mkspec.lastIndexOf('/');
if(index == -1)
index = mkspec.lastIndexOf('\\');
if (index >= 0 && QDir(mkspec.left(index)).canonicalPath() == QDir(m_path + "/mkspecs/").canonicalPath())
......
......@@ -67,6 +67,7 @@ public:
QString path() const;
QString sourcePath() const;
QString mkspec() const;
QString mkspecPath() const;
QString makeCommand() const;
QString qmakeCommand() const;
// Returns the PREFIX, BINPREFIX, DOCPREFIX and similar information
......@@ -107,6 +108,7 @@ private:
QString m_path;
QString m_sourcePath;
mutable QString m_mkspec; // updated lazily
mutable QString m_mkspecFullPath;
QString m_mingwDirectory;
QString m_prependPath;
QString m_msvcVersion;
......
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