diff options
author | Brad King <brad.king@kitware.com> | 2014-07-29 17:36:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-29 19:06:28 (GMT) |
commit | c2ef6d238a5e30234756a38943436e326b986b58 (patch) | |
tree | 894fb66e9741d28760c929e7d85ec2f3a0dc5f31 | |
parent | 2df389115e7636756cd1f1d6c422651b4899522d (diff) | |
download | CMake-c2ef6d238a5e30234756a38943436e326b986b58.zip CMake-c2ef6d238a5e30234756a38943436e326b986b58.tar.gz CMake-c2ef6d238a5e30234756a38943436e326b986b58.tar.bz2 |
VS: Refactor handling of "header" sources in VS >= 10
Create a WriteHeaderSource method to handle writing of sources
classified by cmGeneratorTarget as header files. This will be
useful to add special VS-specific handling for some headers.
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index d50bdde..22e2461 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -997,6 +997,11 @@ WriteGroupSources(const char* name, this->WriteString("</ItemGroup>\n", 1); } +void cmVisualStudio10TargetGenerator::WriteHeaderSource(cmSourceFile const* sf) +{ + this->WriteSource("ClInclude", sf); +} + void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) { this->WriteSource("None", sf); @@ -1079,7 +1084,11 @@ void cmVisualStudio10TargetGenerator::WriteAllSources() std::vector<cmSourceFile const*> headerSources; this->GeneratorTarget->GetHeaderSources(headerSources, ""); - this->WriteSources("ClInclude", headerSources); + for(std::vector<cmSourceFile const*>::const_iterator + si = headerSources.begin(); si != headerSources.end(); ++si) + { + this->WriteHeaderSource(*si); + } std::vector<cmSourceFile const*> idlSources; this->GeneratorTarget->GetIDLSources(idlSources, ""); this->WriteSources("Midl", idlSources); diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 8966f93..7436372 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 WriteHeaderSource(cmSourceFile const* sf); void WriteExtraSource(cmSourceFile const* sf); void WriteSource(std::string const& tool, cmSourceFile const* sf, const char* end = 0); |