From 2df389115e7636756cd1f1d6c422651b4899522d Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 29 Jul 2014 13:32:22 -0400 Subject: [PATCH] VS: Refactor handling of "extra" sources in VS >= 10 Create a WriteExtraSource method to handle writing of sources not classified by cmGeneratorTarget for any particular purpose. This will be useful to add special VS-specific handling for some sources. --- Source/cmVisualStudio10TargetGenerator.cxx | 11 ++++++++++- Source/cmVisualStudio10TargetGenerator.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index ca6c41e26..d50bdde1f 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -997,6 +997,11 @@ WriteGroupSources(const char* name, this->WriteString("\n", 1); } +void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) +{ + this->WriteSource("None", sf); +} + void cmVisualStudio10TargetGenerator::WriteSource( std::string const& tool, cmSourceFile const* sf, const char* end) { @@ -1157,7 +1162,11 @@ void cmVisualStudio10TargetGenerator::WriteAllSources() std::vector extraSources; this->GeneratorTarget->GetExtraSources(extraSources, ""); - this->WriteSources("None", extraSources); + for(std::vector::const_iterator + si = extraSources.begin(); si != extraSources.end(); ++si) + { + this->WriteExtraSource(*si); + } // Add object library contents as external objects. std::vector objs; diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 23d86dad7..8966f9374 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -57,6 +57,7 @@ private: void WriteProjectConfigurations(); void WriteProjectConfigurationValues(); void WriteMSToolConfigurationValues(std::string const& config); + void WriteExtraSource(cmSourceFile const* sf); void WriteSource(std::string const& tool, cmSourceFile const* sf, const char* end = 0); void WriteSources(std::string const& tool,