Fixes: Find the qplatformdefs.h file

Task:     -
RevBy:    -
AutoTest: -
Details:  Add the include path for qplatformdefs.h to the fot.
This commit is contained in:
dt
2008-12-08 12:44:28 +01:00
parent e503e1e4e9
commit 83d5461c7f
4 changed files with 33 additions and 21 deletions

View File

@@ -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())