summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraSublimeTextGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmExtraSublimeTextGenerator.cxx')
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx37
1 files changed, 18 insertions, 19 deletions
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index ac0202b..92d38b9 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -20,7 +20,6 @@
#include "cmMakefile.h"
#include "cmSourceFile.h"
#include "cmSystemTools.h"
-#include "cmTarget.h"
#include <cmsys/SystemTools.hxx>
@@ -162,11 +161,12 @@ void cmExtraSublimeTextGenerator::
lg!=lgs.end(); lg++)
{
cmMakefile* makefile=(*lg)->GetMakefile();
- cmTargets& targets=makefile->GetTargets();
- for (cmTargets::iterator ti = targets.begin();
+ std::vector<cmGeneratorTarget*> targets=(*lg)->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::iterator ti = targets.begin();
ti != targets.end(); ti++)
{
- switch(ti->second.GetType())
+ std::string targetName = (*ti)->GetName();
+ switch((*ti)->GetType())
{
case cmState::GLOBAL_TARGET:
{
@@ -175,7 +175,7 @@ void cmExtraSublimeTextGenerator::
if (strcmp((*lg)->GetCurrentBinaryDirectory(),
(*lg)->GetBinaryDirectory())==0)
{
- this->AppendTarget(fout, ti->first, *lg, 0,
+ this->AppendTarget(fout, targetName, *lg, 0,
make.c_str(), makefile, compiler.c_str(),
sourceFileFlags, false);
}
@@ -184,15 +184,16 @@ void cmExtraSublimeTextGenerator::
case cmState::UTILITY:
// Add all utility targets, except the Nightly/Continuous/
// Experimental-"sub"targets as e.g. NightlyStart
- if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly"))
- || ((ti->first.find("Continuous")==0)&&(ti->first!="Continuous"))
- || ((ti->first.find("Experimental")==0)
- && (ti->first!="Experimental")))
+ if (((targetName.find("Nightly")==0) &&(targetName!="Nightly"))
+ || ((targetName.find("Continuous")==0)
+ &&(targetName!="Continuous"))
+ || ((targetName.find("Experimental")==0)
+ && (targetName!="Experimental")))
{
break;
}
- this->AppendTarget(fout, ti->first, *lg, 0,
+ this->AppendTarget(fout, targetName, *lg, 0,
make.c_str(), makefile, compiler.c_str(),
sourceFileFlags, false);
break;
@@ -202,12 +203,12 @@ void cmExtraSublimeTextGenerator::
case cmState::MODULE_LIBRARY:
case cmState::OBJECT_LIBRARY:
{
- this->AppendTarget(fout, ti->first, *lg, &ti->second,
+ this->AppendTarget(fout, targetName, *lg, *ti,
make.c_str(), makefile, compiler.c_str(),
sourceFileFlags, false);
- std::string fastTarget = ti->first;
+ std::string fastTarget = targetName;
fastTarget += "/fast";
- this->AppendTarget(fout, fastTarget, *lg, &ti->second,
+ this->AppendTarget(fout, fastTarget, *lg, *ti,
make.c_str(), makefile, compiler.c_str(),
sourceFileFlags, false);
}
@@ -223,7 +224,7 @@ void cmExtraSublimeTextGenerator::
AppendTarget(cmGeneratedFileStream& fout,
const std::string& targetName,
cmLocalGenerator* lg,
- cmTarget* target,
+ cmGeneratorTarget* target,
const char* make,
const cmMakefile* makefile,
const char*, //compiler
@@ -233,10 +234,8 @@ void cmExtraSublimeTextGenerator::
if (target != 0)
{
- cmGeneratorTarget *gtgt = this->GlobalGenerator
- ->GetGeneratorTarget(target);
std::vector<cmSourceFile*> sourceFiles;
- gtgt->GetSourceFiles(sourceFiles,
+ target->GetSourceFiles(sourceFiles,
makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
std::vector<cmSourceFile*>::const_iterator sourceFilesEnd =
sourceFiles.end();
@@ -254,9 +253,9 @@ void cmExtraSublimeTextGenerator::
}
std::vector<std::string>& flags = sourceFileFlagsIter->second;
std::string flagsString =
- this->ComputeFlagsForObject(*iter, lg, gtgt);
+ this->ComputeFlagsForObject(*iter, lg, target);
std::string definesString =
- this->ComputeDefines(*iter, lg, gtgt);
+ this->ComputeDefines(*iter, lg, target);
flags.clear();
cmsys::RegularExpression flagRegex;
// Regular expression to extract compiler flags from a string