From 8e026aa7f27aaa545b6421e61d7ba3add1c5d10d Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 13 Aug 2014 13:24:48 -0400 Subject: VS: Refactor include directory slash conversion Convert each include directory to windows slashes once instead of repeating it each time they are written out to the project file. --- Source/cmVisualStudio10TargetGenerator.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 1e9e8e8..5ad63b5 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1584,9 +1584,7 @@ OutputIncludes(std::vector const & includes) for(std::vector::const_iterator i = includes.begin(); i != includes.end(); ++i) { - std::string incDir = *i; - this->ConvertToWindowsSlash(incDir); - *this->BuildFileStream << cmVS10EscapeXML(incDir) << ";"; + *this->BuildFileStream << cmVS10EscapeXML(*i) << ";"; } this->WriteString("%(AdditionalIncludeDirectories)" "\n", 0); @@ -1978,6 +1976,11 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups() this->LocalGenerator->GetIncludeDirectories(includes, this->GeneratorTarget, "C", i->c_str()); + for(std::vector::iterator ii = includes.begin(); + ii != includes.end(); ++ii) + { + this->ConvertToWindowsSlash(*ii); + } this->WritePlatformConfigTag("ItemDefinitionGroup", i->c_str(), 1); *this->BuildFileStream << "\n"; // output cl compile flags -- cgit v0.12