summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-12 12:45:14 +0100
committerStephen Kelly <steveire@gmail.com>2014-03-31 23:18:43 +0200
commit26d494ba01809553e335cca4f925d14dab2c50f7 (patch)
tree706f1662f3cba1ee836568634256930c251b5b9f /Source
parentd38423ecc4105d8339b7461130b964f3c69e8847 (diff)
downloadcmake-26d494ba01809553e335cca4f925d14dab2c50f7.tar.gz
cmTarget: Use string API to add sources to cmTarget objects.
Continue to call GetOrCreateSource where necessary to create cmSourceFile objects which have the GENERATED attribute set.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmFLTKWrapUICommand.cxx2
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx3
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx6
-rw-r--r--Source/cmLocalGenerator.cxx4
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx6
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx4
-rw-r--r--Source/cmMakefile.cxx2
-rw-r--r--Source/cmQtAutoGenerators.cxx17
8 files changed, 21 insertions, 23 deletions
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index 0a36b825b6..e2b114a16c 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -168,7 +168,7 @@ void cmFLTKWrapUICommand::FinalPass()
for(size_t classNum = 0; classNum < lastHeadersClass; classNum++)
{
this->Makefile->GetTargets()[this->Target]
- .AddSourceFile(this->GeneratedSourcesClasses[classNum]);
+ .AddSource(this->GeneratedSourcesClasses[classNum]->GetFullPath());
}
}
}
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index ab4380c3f4..e80df845d2 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -16,6 +16,7 @@
#include "cmVisualStudioWCEPlatformParser.h"
#include "cmake.h"
#include "cmGeneratedFileStream.h"
+#include "cmSourceFile.h"
static const char vs8generatorName[] = "Visual Studio 8 2005";
@@ -323,7 +324,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
no_main_dependency, commandLines, "Checking Build System",
no_working_directory, true))
{
- tgt->AddSourceFile(file);
+ tgt->AddSource(file->GetFullPath());
}
else
{
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f93fc12478..96b23d228e 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1260,7 +1260,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
if(cmSourceFile* sf = mf->GetOrCreateSource(fname.c_str()))
{
sf->SetProperty("LANGUAGE", llang.c_str());
- cmtarget.AddSourceFile(sf);
+ cmtarget.AddSource(fname);
}
}
@@ -2934,8 +2934,8 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
if(cmtarget.GetPropertyAsBool("MACOSX_BUNDLE"))
{
std::string plist = this->ComputeInfoPListLocation(cmtarget);
- cmSourceFile* sf = mf->GetOrCreateSource(plist.c_str(), true);
- cmtarget.AddSourceFile(sf);
+ mf->GetOrCreateSource(plist, true);
+ cmtarget.AddSource(plist);
}
std::vector<cmSourceFile*> classes;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index c47147c561..61d2a8021b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -754,8 +754,8 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
comment.c_str(),
this->Makefile->GetStartOutputDirectory()
);
- target.Target->AddSourceFile
- (this->Makefile->GetSource(targetFullPath));
+ this->Makefile->GetSource(targetFullPath);
+ target.Target->AddSource(targetFullPath);
}
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 2ab25cc52c..e99f3a4adb 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -253,9 +253,9 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt)
makefileIn.c_str(), commandLines,
comment.c_str(),
no_working_directory, true);
- if(cmSourceFile* file = this->Makefile->GetSource(makefileIn.c_str()))
+ if(this->Makefile->GetSource(makefileIn.c_str()))
{
- tgt.AddSourceFile(file);
+ tgt.AddSource(makefileIn);
}
else
{
@@ -591,7 +591,7 @@ cmLocalVisualStudio6Generator
origCommand.GetCommandLines(), comment,
origCommand.GetWorkingDirectory().c_str()))
{
- target.AddSourceFile(outsf);
+ target.AddSource(outsf->GetFullPath());
}
// Replace the dependencies with the output of this rule so that the
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 52524aa57a..e8562ca92f 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -117,7 +117,7 @@ void cmLocalVisualStudio7Generator::AddCMakeListsRules()
{
if(l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET)
{
- l->second.AddSourceFile(sf);
+ l->second.AddSource(sf->GetFullPath());
}
}
}
@@ -153,7 +153,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
force.c_str(), no_depends, no_main_dependency,
force_commands, " ", 0, true))
{
- tgt.AddSourceFile(file);
+ tgt.AddSource(file->GetFullPath());
}
}
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 1fcbcd783c..06dc0c5f57 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1182,7 +1182,7 @@ cmMakefile::AddCustomCommandOldStyle(const std::string& target,
{
if (this->Targets.find(target) != this->Targets.end())
{
- this->Targets[target].AddSourceFile(sf);
+ this->Targets[target].AddSource(sf->GetFullPath());
}
else
{
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index a6e6af7e43..71c4630e0a 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -187,13 +187,11 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
mocCppFile += "/";
mocCppFile += automocTargetName;
mocCppFile += ".cpp";
- cmSourceFile* mocCppSource = makefile->GetOrCreateSource(
- mocCppFile,
- true);
+ makefile->GetOrCreateSource(mocCppFile, true);
makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
mocCppFile.c_str(), false);
- target->AddSourceFile(mocCppSource);
+ target->AddSource(mocCppFile);
}
// create a custom target for running generators at buildtime:
std::string autogenTargetName = getAutogenTargetName(target);
@@ -479,7 +477,7 @@ void cmQtAutoGenerators::SetupSourceFiles(cmTarget const* target)
const char *skipMocSep = "";
const char *skipUicSep = "";
- std::vector<cmSourceFile*> newRccFiles;
+ std::vector<std::string> newRccFiles;
for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
fileIt != srcFiles.end();
@@ -512,9 +510,8 @@ void cmQtAutoGenerators::SetupSourceFiles(cmTarget const* target)
rcc_output_file += "/qrc_" + basename + ".cpp";
makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
rcc_output_file.c_str(), false);
- cmSourceFile* rccCppSource
- = makefile->GetOrCreateSource(rcc_output_file, true);
- newRccFiles.push_back(rccCppSource);
+ makefile->GetOrCreateSource(rcc_output_file, true);
+ newRccFiles.push_back(rcc_output_file);
}
}
@@ -546,11 +543,11 @@ void cmQtAutoGenerators::SetupSourceFiles(cmTarget const* target)
}
}
- for(std::vector<cmSourceFile*>::const_iterator fileIt = newRccFiles.begin();
+ for(std::vector<std::string>::const_iterator fileIt = newRccFiles.begin();
fileIt != newRccFiles.end();
++fileIt)
{
- const_cast<cmTarget*>(target)->AddSourceFile(*fileIt);
+ const_cast<cmTarget*>(target)->AddSource(*fileIt);
}
}