From 0ed5ce4cd8cdd7613a5fa43c9a9fc48f210c90f6 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 17 Mar 2014 16:54:11 +0100 Subject: cmTarget: Rename AddSource method for backward compatibility. Add a new AddSource method for future use. --- Source/cmGlobalXCodeGenerator.cxx | 4 ++-- Source/cmMakefile.cxx | 2 +- Source/cmTarget.cxx | 9 +++++++-- Source/cmTarget.h | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index d4eb85b..f93fc12 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -412,7 +412,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, std::string listfile = mf->GetStartDirectory(); listfile += "/"; listfile += "CMakeLists.txt"; - allbuild->AddSource(listfile.c_str()); + allbuild->AddSourceCMP0049(listfile.c_str()); // Add XCODE depend helper std::string dir = mf->GetCurrentOutputDirectory(); @@ -495,7 +495,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, listfile = lg->GetMakefile()->GetStartDirectory(); listfile += "/"; listfile += "CMakeLists.txt"; - target.AddSource(listfile.c_str()); + target.AddSourceCMP0049(listfile.c_str()); } } } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index dce71de..1fcbcd7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1266,7 +1266,7 @@ cmMakefile::AddUtilityCommand(const std::string& utilityName, commandLines, comment, workingDirectory, no_replace, escapeOldStyle); - cmSourceFile* sf = target->AddSource(force); + cmSourceFile* sf = target->AddSourceCMP0049(force); // The output is not actually created so mark it symbolic. if(sf) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index a7c4488..835aaad 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -587,13 +587,13 @@ void cmTarget::AddSources(std::vector const& srcs) } else { - this->AddSource(src); + this->AddSourceCMP0049(src); } } } //---------------------------------------------------------------------------- -cmSourceFile* cmTarget::AddSource(const std::string& s) +cmSourceFile* cmTarget::AddSourceCMP0049(const std::string& s) { std::string src = s; @@ -632,7 +632,12 @@ cmSourceFile* cmTarget::AddSource(const std::string& s) } } } + return this->AddSource(src); +} +//---------------------------------------------------------------------------- +cmSourceFile* cmTarget::AddSource(const std::string& src) +{ cmSourceFile* sf = this->Makefile->GetOrCreateSource(src); this->AddSourceFile(sf); return sf; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 3ef853b..e385443 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -146,6 +146,7 @@ public: * Add sources to the target. */ void AddSources(std::vector const& srcs); + cmSourceFile* AddSourceCMP0049(const std::string& src); cmSourceFile* AddSource(const std::string& src); enum LinkLibraryType {GENERAL, DEBUG, OPTIMIZED}; -- cgit v0.12