diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2003-10-17 20:19:37 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2003-10-17 20:19:37 (GMT) |
commit | 16fe0862672a81dd79513ffc89074d25041cc9b0 (patch) | |
tree | 2881b70f9880a4694b0237a52bc3636e0b00435d | |
parent | 9a4c654d239f36c6187262ea708d75f054ea49da (diff) | |
download | CMake-16fe0862672a81dd79513ffc89074d25041cc9b0.zip CMake-16fe0862672a81dd79513ffc89074d25041cc9b0.tar.gz CMake-16fe0862672a81dd79513ffc89074d25041cc9b0.tar.bz2 |
BUG: make sure -M flags are not duplicated and are only set in the xml
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index b740bb2..5d55adc 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -344,46 +344,58 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, << "\t\t\t\tAdditionalOptions=\""; cmSystemTools::ReplaceString(flags, "\"", """); - fout << flags; - - fout << " -DCMAKE_INTDIR=\\"" << configName << "\\"" - << "\"\n"; - - fout << "\t\t\t\tAdditionalIncludeDirectories=\""; - std::vector<std::string>& includes = m_Makefile->GetIncludeDirectories(); - std::vector<std::string>::iterator i = includes.begin(); - for(;i != includes.end(); ++i) - { - std::string ipath = this->ConvertToXMLOutputPath(i->c_str()); - fout << ipath << ";"; - } - fout << "\"\n"; // check the flags for the run time library flag options // if there is a match set the run time flag if(flags.find("MTd") != flags.npos) { + cmSystemTools::ReplaceString(flags, "-MTd", ""); + cmSystemTools::ReplaceString(flags, "/MTd", ""); runtime = 1; } else if (flags.find("MDd") != flags.npos) { + cmSystemTools::ReplaceString(flags, "-MDd", ""); + cmSystemTools::ReplaceString(flags, "/MDd", ""); runtime = 3; } else if (flags.find("MLd") != flags.npos) { + cmSystemTools::ReplaceString(flags, "-MLd", ""); + cmSystemTools::ReplaceString(flags, "/MLd", ""); runtime = 5; } else if (flags.find("MT") != flags.npos) { + cmSystemTools::ReplaceString(flags, "-MT", ""); + cmSystemTools::ReplaceString(flags, "/MT", ""); runtime = 0; } else if (flags.find("MD") != flags.npos) { + cmSystemTools::ReplaceString(flags, "-MD", ""); + cmSystemTools::ReplaceString(flags, "/MD", ""); runtime = 2; } else if (flags.find("ML") != flags.npos) { + cmSystemTools::ReplaceString(flags, "-ML", ""); + cmSystemTools::ReplaceString(flags, "/ML", ""); runtime = 4; } + fout << flags; + + fout << " -DCMAKE_INTDIR=\\"" << configName << "\\"" + << "\"\n"; + + fout << "\t\t\t\tAdditionalIncludeDirectories=\""; + std::vector<std::string>& includes = m_Makefile->GetIncludeDirectories(); + std::vector<std::string>::iterator i = includes.begin(); + for(;i != includes.end(); ++i) + { + std::string ipath = this->ConvertToXMLOutputPath(i->c_str()); + fout << ipath << ";"; + } + fout << "\"\n"; fout << "\t\t\t\tOptimization=\"" << optimized << "\"\n" << "\t\t\t\tRuntimeLibrary=\"" << runtime << "\"\n" |