forked from qt-creator/qt-creator
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:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user