diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index fe591fa004193d7691d669c5d2ec5b11194223a1..4eb31302e650467576100a2486ea3f6fd4d6b97a 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -393,12 +393,36 @@ void CMakeCbpParser::parseBuild() 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()) { + readNext(); + if (isEndElement()) { + return; } else if (isStartElement()) { parseUnknownElement(); } diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.h b/src/plugins/cmakeprojectmanager/cmakeproject.h index c765c0d38387cbf0e3ce6f9dc47273ae22fcc869..a0c821ada5ebbe5e61267fa3f41824fdbac9d119 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.h +++ b/src/plugins/cmakeprojectmanager/cmakeproject.h @@ -123,13 +123,18 @@ private: void parseProject(); void parseBuild(); void parseTarget(); + void parseTargetOption(); void parseCompiler(); void parseAdd(); void parseUnit(); void parseUnknownElement(); + QSet<QString> m_targets; QList<ProjectExplorer::FileNode *> m_fileList; QStringList m_includeFiles; + + QString m_targetOutput; + bool m_targetType; }; class CMakeFile : public Core::IFile