Skip to content
Snippets Groups Projects
Commit 3ae3e3f3 authored by Erik's avatar Erik Committed by dt
Browse files

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: default avatardt <qtc-committer@nokia.com>
parent 0b5ffee8
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......@@ -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;
......
......@@ -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"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment