Fixes: Parse all the targets.

Task:     -
RevBy:    -
AutoTest: -
Details:  (Only outputs them via qDebug().)
This commit is contained in:
dt
2008-12-08 12:24:31 +01:00
parent 440053f71e
commit e503e1e4e9
2 changed files with 31 additions and 2 deletions
@@ -393,12 +393,36 @@ void CMakeCbpParser::parseBuild()
void CMakeCbpParser::parseTarget() void CMakeCbpParser::parseTarget()
{ {
m_targetOutput.clear();
m_targetType = false;
while(!atEnd()) {
readNext();
if (isEndElement()) {
if (m_targetType && !m_targetOutput.isEmpty()) {
qDebug()<<"found target "<<m_targetOutput;
m_targets.insert(m_targetOutput);
}
return;
} else if (name() == "Compiler") {
parseCompiler();
} else if (name() == "Option") {
parseTargetOption();
} else if (isStartElement()) {
parseUnknownElement();
}
}
}
void CMakeCbpParser::parseTargetOption()
{
if (attributes().hasAttribute("output"))
m_targetOutput = attributes().value("output").toString();
else if (attributes().hasAttribute("type") && attributes().value("type") == "1")
m_targetType = true;
while(!atEnd()) { while(!atEnd()) {
readNext(); readNext();
if (isEndElement()) { if (isEndElement()) {
return; return;
} else if (name() == "Compiler") {
parseCompiler();
} else if (isStartElement()) { } else if (isStartElement()) {
parseUnknownElement(); parseUnknownElement();
} }
@@ -123,13 +123,18 @@ private:
void parseProject(); void parseProject();
void parseBuild(); void parseBuild();
void parseTarget(); void parseTarget();
void parseTargetOption();
void parseCompiler(); void parseCompiler();
void parseAdd(); void parseAdd();
void parseUnit(); void parseUnit();
void parseUnknownElement(); void parseUnknownElement();
QSet<QString> m_targets;
QList<ProjectExplorer::FileNode *> m_fileList; QList<ProjectExplorer::FileNode *> m_fileList;
QStringList m_includeFiles; QStringList m_includeFiles;
QString m_targetOutput;
bool m_targetType;
}; };
class CMakeFile : public Core::IFile class CMakeFile : public Core::IFile