summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-07-14 16:22:57 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-01-09 18:38:08 (GMT)
commit531e40b95e80fbf5547b0a8d71196e819bb3aa3d (patch)
treec1b9f09d329496f511135c9665275e8fc21f6ccf
parent38de54cf6f3daae70792fae1bf26b97bccc78de4 (diff)
downloadCMake-531e40b95e80fbf5547b0a8d71196e819bb3aa3d.zip
CMake-531e40b95e80fbf5547b0a8d71196e819bb3aa3d.tar.gz
CMake-531e40b95e80fbf5547b0a8d71196e819bb3aa3d.tar.bz2
cmTarget: Make GetSourceFiles populate an out-vector parameter.
In a future patch, this will also be populated with extra sources from the linked dependencies.
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx3
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx3
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx3
-rw-r--r--Source/cmFLTKWrapUICommand.cxx4
-rw-r--r--Source/cmGeneratorTarget.cxx10
-rw-r--r--Source/cmGeneratorTarget.h2
-rw-r--r--Source/cmGlobalGenerator.cxx3
-rw-r--r--Source/cmGlobalKdevelopGenerator.cxx3
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx12
-rw-r--r--Source/cmLocalGenerator.cxx6
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx3
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx3
-rw-r--r--Source/cmMakefileTargetGenerator.cxx4
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx4
-rw-r--r--Source/cmQtAutoGenerators.cxx12
-rw-r--r--Source/cmTarget.cxx7
-rw-r--r--Source/cmTarget.h2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx3
18 files changed, 54 insertions, 33 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index fce1284..a066153 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -398,7 +398,8 @@ void cmExtraCodeBlocksGenerator
case cmTarget::OBJECT_LIBRARY:
case cmTarget::UTILITY: // can have sources since 2.6.3
{
- const std::vector<cmSourceFile*>&sources=ti->second.GetSourceFiles();
+ std::vector<cmSourceFile*> sources;
+ ti->second.GetSourceFiles(sources);
for (std::vector<cmSourceFile*>::const_iterator si=sources.begin();
si!=sources.end(); si++)
{
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index c93187e..3e9b786 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -559,7 +559,8 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
std::vector<cmSourceGroup> sourceGroups=makefile->GetSourceGroups();
// get the files from the source lists then add them to the groups
cmTarget* tgt = const_cast<cmTarget*>(&ti->second);
- std::vector<cmSourceFile*>const & files = tgt->GetSourceFiles();
+ std::vector<cmSourceFile*> files;
+ tgt->GetSourceFiles(files);
for(std::vector<cmSourceFile*>::const_iterator sfIt = files.begin();
sfIt != files.end();
sfIt++)
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 9cbdd7c..52411e8 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -237,7 +237,8 @@ void cmExtraSublimeTextGenerator::
{
cmGeneratorTarget *gtgt = this->GlobalGenerator
->GetGeneratorTarget(target);
- std::vector<cmSourceFile*> const& sourceFiles = target->GetSourceFiles();
+ std::vector<cmSourceFile*> sourceFiles;
+ target->GetSourceFiles(sourceFiles);
std::vector<cmSourceFile*>::const_iterator sourceFilesEnd =
sourceFiles.end();
for (std::vector<cmSourceFile*>::const_iterator iter =
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index b08c335..4ce1ea5 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -132,8 +132,8 @@ void cmFLTKWrapUICommand::FinalPass()
cmSystemTools::Message(msg.c_str(),"Warning");
return;
}
- std::vector<cmSourceFile*> const& srcs =
- target->GetSourceFiles();
+ std::vector<cmSourceFile*> srcs;
+ target->GetSourceFiles(srcs);
bool found = false;
for (unsigned int i = 0; i < srcs.size(); ++i)
{
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 88f533c..5cd1f42 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -284,9 +284,9 @@ bool cmGeneratorTarget::GetPropertyAsBool(const char *prop) const
}
//----------------------------------------------------------------------------
-std::vector<cmSourceFile*> const& cmGeneratorTarget::GetSourceFiles() const
+void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files) const
{
- return this->Target->GetSourceFiles();
+ this->Target->GetSourceFiles(files);
}
//----------------------------------------------------------------------------
@@ -298,7 +298,8 @@ void cmGeneratorTarget::ClassifySources()
bool isObjLib = targetType == cmTarget::OBJECT_LIBRARY;
std::vector<cmSourceFile*> badObjLib;
- std::vector<cmSourceFile*> const& sources = this->Target->GetSourceFiles();
+ std::vector<cmSourceFile*> sources;
+ this->Target->GetSourceFiles(sources);
for(std::vector<cmSourceFile*>::const_iterator si = sources.begin();
si != sources.end(); ++si)
{
@@ -496,7 +497,8 @@ cmTargetTraceDependencies
this->CurrentEntry = 0;
// Queue all the source files already specified for the target.
- std::vector<cmSourceFile*> const& sources = this->Target->GetSourceFiles();
+ std::vector<cmSourceFile*> sources;
+ this->Target->GetSourceFiles(sources);
for(std::vector<cmSourceFile*>::const_iterator si = sources.begin();
si != sources.end(); ++si)
{
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 4c023bf..17a223a 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -30,7 +30,7 @@ public:
const char *GetName() const;
const char *GetProperty(const char *prop) const;
bool GetPropertyAsBool(const char *prop) const;
- std::vector<cmSourceFile*> const& GetSourceFiles() const;
+ void GetSourceFiles(std::vector<cmSourceFile*>& files) const;
void GetObjectSources(std::vector<cmSourceFile*> &) const;
const std::string& GetObjectName(cmSourceFile const* file);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 82c9155..f5914c8 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2884,7 +2884,8 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target)
// List the source files with any per-source labels.
fout << "# Source files and their labels\n";
- std::vector<cmSourceFile*> const& sources = target->GetSourceFiles();
+ std::vector<cmSourceFile*> sources;
+ target->GetSourceFiles(sources);
for(std::vector<cmSourceFile*>::const_iterator si = sources.begin();
si != sources.end(); ++si)
{
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index 61ff45b..ed0e15b 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -138,7 +138,8 @@ bool cmGlobalKdevelopGenerator
for (cmTargets::iterator ti = targets.begin();
ti != targets.end(); ti++)
{
- const std::vector<cmSourceFile*>& sources=ti->second.GetSourceFiles();
+ std::vector<cmSourceFile*> sources;
+ ti->second.GetSourceFiles(sources);
for (std::vector<cmSourceFile*>::const_iterator si=sources.begin();
si!=sources.end(); si++)
{
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 09d8124..f7a42fc 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -991,7 +991,8 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
}
// organize the sources
- std::vector<cmSourceFile*> classes = cmtarget.GetSourceFiles();
+ std::vector<cmSourceFile*> classes;
+ cmtarget.GetSourceFiles(classes);
std::sort(classes.begin(), classes.end(), cmSourceFilePathCompare());
std::vector<cmXCodeObject*> externalObjFiles;
@@ -1360,7 +1361,8 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
postbuild.push_back(command);
}
- std::vector<cmSourceFile*>const &classes = cmtarget.GetSourceFiles();
+ std::vector<cmSourceFile*> classes;
+ cmtarget.GetSourceFiles(classes);
// add all the sources
std::vector<cmCustomCommand> commands;
for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
@@ -2442,7 +2444,8 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
// Add source files without build rules for editing convenience.
if(cmtarget.GetType() == cmTarget::UTILITY)
{
- std::vector<cmSourceFile*> const& sources = cmtarget.GetSourceFiles();
+ std::vector<cmSourceFile*> sources;
+ cmtarget.GetSourceFiles(sources);
for(std::vector<cmSourceFile*>::const_iterator i = sources.begin();
i != sources.end(); ++i)
{
@@ -2945,7 +2948,8 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
cmtarget.AddSourceFile(sf);
}
- std::vector<cmSourceFile*> classes = cmtarget.GetSourceFiles();
+ std::vector<cmSourceFile*> classes;
+ cmtarget.GetSourceFiles(classes);
// Put cmSourceFile instances in proper groups:
for(std::vector<cmSourceFile*>::const_iterator s = classes.begin();
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 455f542..3effe38 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -657,7 +657,8 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang,
cmStdString objs;
std::vector<std::string> objVector;
// Add all the sources outputs to the depends of the target
- std::vector<cmSourceFile*> const& classes = target.GetSourceFiles();
+ std::vector<cmSourceFile*> classes;
+ target.GetSourceFiles(classes);
for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
i != classes.end(); ++i)
{
@@ -1631,7 +1632,8 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
if(this->Makefile->IsOn("WIN32") &&
!(this->Makefile->IsOn("CYGWIN") || this->Makefile->IsOn("MINGW")))
{
- const std::vector<cmSourceFile*>& sources = target->GetSourceFiles();
+ std::vector<cmSourceFile*> sources;
+ target->GetSourceFiles(sources);
for(std::vector<cmSourceFile*>::const_iterator i = sources.begin();
i != sources.end(); ++i)
{
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index f10216a..fb12521 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -314,7 +314,8 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
std::vector<cmSourceGroup> sourceGroups = this->Makefile->GetSourceGroups();
// get the classes from the source lists then add them to the groups
- std::vector<cmSourceFile*> const & classes = target.GetSourceFiles();
+ std::vector<cmSourceFile*> classes;
+ target.GetSourceFiles(classes);
// now all of the source files have been properly assigned to the target
// now stick them into source groups using the reg expressions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 1a47ca3..57a4880 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1381,7 +1381,8 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
// get the classes from the source lists then add them to the groups
this->ModuleDefinitionFile = "";
- std::vector<cmSourceFile*>const & classes = target.GetSourceFiles();
+ std::vector<cmSourceFile*> classes;
+ target.GetSourceFiles(classes);
for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
i != classes.end(); i++)
{
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 25b2b4c..7f90078 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1152,8 +1152,8 @@ cmMakefileTargetGenerator
::DriveCustomCommands(std::vector<std::string>& depends)
{
// Depend on all custom command outputs.
- const std::vector<cmSourceFile*>& sources =
- this->Target->GetSourceFiles();
+ std::vector<cmSourceFile*> sources;
+ this->Target->GetSourceFiles(sources);
for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
source != sources.end(); ++source)
{
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 8556565..1a7b445 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -42,8 +42,8 @@ void cmNinjaUtilityTargetGenerator::Generate()
}
}
- const std::vector<cmSourceFile*>& sources =
- this->GetTarget()->GetSourceFiles();
+ std::vector<cmSourceFile*> sources;
+ this->GetTarget()->GetSourceFiles(sources);
for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
source != sources.end(); ++source)
{
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index bd7e75a..da22ab5 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -451,7 +451,8 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
const char* sepFiles = "";
const char* sepHeaders = "";
- const std::vector<cmSourceFile*>& srcFiles = target->GetSourceFiles();
+ std::vector<cmSourceFile*> srcFiles;
+ target->GetSourceFiles(srcFiles);
std::string skip_moc;
const char *sep = "";
@@ -643,7 +644,8 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
const char *qtUic = makefile->GetSafeDefinition("QT_UIC_EXECUTABLE");
makefile->AddDefinition("_qt_uic_executable", qtUic);
- const std::vector<cmSourceFile*>& srcFiles = target->GetSourceFiles();
+ std::vector<cmSourceFile*> srcFiles;
+ target->GetSourceFiles(srcFiles);
std::string skip_uic;
const char *sep = "";
@@ -809,7 +811,8 @@ void cmQtAutoGenerators::InitializeAutoRccTarget(cmTarget* target)
{
cmMakefile *makefile = target->GetMakefile();
- const std::vector<cmSourceFile*>& srcFiles = target->GetSourceFiles();
+ std::vector<cmSourceFile*> srcFiles;
+ target->GetSourceFiles(srcFiles);
std::vector<cmSourceFile*> newFiles;
@@ -855,7 +858,8 @@ void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target)
const char* sepRccFiles = "";
cmMakefile *makefile = target->GetMakefile();
- const std::vector<cmSourceFile*>& srcFiles = target->GetSourceFiles();
+ std::vector<cmSourceFile*> srcFiles;
+ target->GetSourceFiles(srcFiles);
std::string rccFileFiles;
std::string rccFileOptions;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b06480b..d65117d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -530,9 +530,9 @@ bool cmTarget::FindSourceFiles()
}
//----------------------------------------------------------------------------
-std::vector<cmSourceFile*> const& cmTarget::GetSourceFiles() const
+void cmTarget::GetSourceFiles(std::vector<cmSourceFile*> &files) const
{
- return this->SourceFiles;
+ files = this->SourceFiles;
}
//----------------------------------------------------------------------------
@@ -673,7 +673,8 @@ void cmTarget::ConstructSourceFileFlags() const
// Handle the MACOSX_PACKAGE_LOCATION property on source files that
// were not listed in one of the other lists.
- std::vector<cmSourceFile*> const& sources = this->GetSourceFiles();
+ std::vector<cmSourceFile*> sources;
+ this->GetSourceFiles(sources);
for(std::vector<cmSourceFile*>::const_iterator si = sources.begin();
si != sources.end(); ++si)
{
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 4916648..26d391f 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -132,7 +132,7 @@ public:
/**
* Get the list of the source files used by this target
*/
- std::vector<cmSourceFile*> const& GetSourceFiles() const;
+ void GetSourceFiles(std::vector<cmSourceFile*> &files) const;
void AddSourceFile(cmSourceFile* sf);
std::vector<std::string> const& GetObjectLibraries() const
{
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 0a2c339..46ab383 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -699,7 +699,8 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
// collect up group information
std::vector<cmSourceGroup> sourceGroups =
this->Makefile->GetSourceGroups();
- std::vector<cmSourceFile*> classes = this->Target->GetSourceFiles();
+ std::vector<cmSourceFile*> classes;
+ this->Target->GetSourceFiles(classes);
std::set<cmSourceGroup*> groupsUsed;
for(std::vector<cmSourceFile*>::const_iterator s = classes.begin();