diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 320b4403a..42033c5be 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -873,7 +873,8 @@ cmGlobalVisualStudio7Generator::WriteUtilityDepend(cmTarget const* target) std::string guid = this->GetGUID(pname.c_str()); fout << - "\n" + "Encoding() << "\"?>\n" "GetIDEVersion() << "0\"\n" @@ -1038,3 +1039,14 @@ cmIDEFlagTable const* cmGlobalVisualStudio7Generator::GetExtraFlagTableVS7() { return cmVS7ExtraFlagTable; } + +std::string cmGlobalVisualStudio7Generator::Encoding() +{ + std::ostringstream encoding; +#ifdef CMAKE_ENCODING_UTF8 + encoding << "UTF-8"; +#else + encoding << "Windows-1252"; +#endif + return encoding.str(); +} diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 0d2e410c8..1dc709ddd 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -109,6 +109,9 @@ public: virtual void FindMakeProgram(cmMakefile*); + // Encoding for Visual Studio files + virtual std::string Encoding(); + protected: virtual const char* GetIDEVersion() { return "7.0"; } diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 69c893cc8..2b2a4715c 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -1,3 +1,4 @@ + /*============================================================================ CMake - Cross Platform Makefile Generator Copyright 2000-2009 Kitware, Inc., Insight Software Consortium @@ -918,4 +919,4 @@ std::string cmGlobalVisualStudioGenerator::ExpandCFGIntDir( i += config.size(); } return tmp; -} +} \ No newline at end of file diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 14ad56778..52524aa57 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1975,7 +1975,8 @@ cmLocalVisualStudio7Generator cmGlobalVisualStudio7Generator* gg = static_cast(this->GlobalGenerator); - fout << "\n" + fout << "Encoding() << "\"?>\n" << "GetIntelProjectVersion() << "\"\n"; @@ -2038,7 +2039,12 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout, this->WriteProjectStartFortran(fout, libName, target); return; } - fout << "\n" + + cmGlobalVisualStudio7Generator* gg = + static_cast(this->GlobalGenerator); + + fout << "Encoding() << "\"?>\n" << "Version == VS71) @@ -2059,8 +2065,6 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout, { keyword = "Win32Proj"; } - cmGlobalVisualStudio7Generator* gg = - static_cast(this->GlobalGenerator); fout << "\tName=\"" << projLabel << "\"\n"; if(this->Version >= VS8) { diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 7c55f645e..8e8968d9e 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -222,7 +222,8 @@ void cmVisualStudio10TargetGenerator::Generate() //get the tools version to use const std::string toolsVer(this->GlobalGenerator->GetToolsVersion()); std::string project_defaults= - "\n"; + "GlobalGenerator->Encoding() + "\"?>\n"; project_defaults.append("GlobalGenerator->GetToolsVersion()); std::string project_defaults= - "\n"; + "GlobalGenerator->Encoding() + "\"?>\n"; project_defaults.append("