Import library target from cmake project.

Added library flag to CMakeBuildTarget struct which is set when parsing
the cbp file. This flag is then used to make sure no runconfiguration
is created for library targets.

Merge-request: 136
Reviewed-by: dt <qtc-committer@nokia.com>
This commit is contained in:
Erik
2010-04-23 16:24:55 +02:00
committed by dt
parent 0b5ffee800
commit 3ae3e3f330
3 changed files with 13 additions and 5 deletions

View File

@@ -222,7 +222,7 @@ bool CMakeProject::parseCMakeLists()
//qDebug()<<"Adding Targets";
m_buildTargets = cbpparser.buildTargets();
// qDebug()<<"Printing targets";
// foreach(CMakeTarget ct, m_targets) {
// foreach(CMakeBuildTarget ct, m_buildTargets) {
// qDebug()<<ct.title<<" with executable:"<<ct.executable;
// qDebug()<<"WD:"<<ct.workingDirectory;
// qDebug()<<ct.makeCommand<<ct.makeCleanCommand;
@@ -754,12 +754,16 @@ void CMakeCbpParser::parseBuildTarget()
void CMakeCbpParser::parseBuildTargetOption()
{
if (attributes().hasAttribute("output"))
if (attributes().hasAttribute("output")) {
m_buildTarget.executable = attributes().value("output").toString();
else if (attributes().hasAttribute("type") && (attributes().value("type") == "1" || attributes().value("type") == "0"))
} else if (attributes().hasAttribute("type") && (attributes().value("type") == "1" || attributes().value("type") == "0")) {
m_buildTargetType = true;
else if (attributes().hasAttribute("working_dir"))
} else if (attributes().hasAttribute("type") && (attributes().value("type") == "3" || attributes().value("type") == "2")) {
m_buildTargetType = true;
m_buildTarget.library = true;
} else if (attributes().hasAttribute("working_dir")) {
m_buildTarget.workingDirectory = attributes().value("working_dir").toString();
}
while (!atEnd()) {
readNext();
if (isEndElement()) {
@@ -963,5 +967,6 @@ void CMakeBuildTarget::clear()
makeCleanCommand.clear();
workingDirectory.clear();
title.clear();
library = false;
}

View File

@@ -57,7 +57,8 @@ class CMakeBuildSettingsWidget;
struct CMakeBuildTarget
{
QString title;
QString executable;
QString executable; // TODO: rename to output?
bool library;
QString workingDirectory;
QString makeCommand;
QString makeCleanCommand;

View File

@@ -106,6 +106,8 @@ void CMakeTarget::updateRunConfigurations()
}
foreach(const CMakeBuildTarget &ct, cmakeProject()->buildTargets()) {
if (ct.library)
continue;
if (ct.executable.isEmpty())
continue;
if (ct.title.endsWith("/fast"))