From 761cbed509803f8fce4c80447470b9eae67bba14 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 17 Feb 2005 10:39:59 -0500 Subject: FIX: fix for bug 1606 --- Source/cmLocalVisualStudio7Generator.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 87fe048..06d12f1 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -542,15 +542,14 @@ void cmLocalVisualStudio7Generator::FillFlagMapFromCommandFlags( std::string replace; while(flagTable->IDEName) { - if(flags.find(flagTable->commandFlag) != flags.npos) + std::string regex = "((/|-)"; + regex += flagTable->commandFlag; + regex += ")"; + cmsys::RegularExpression reg(regex.c_str()); + while(reg.find(flags)) { - // replace -flag - replace = "-"; - replace += flagTable->commandFlag; - cmSystemTools::ReplaceString(flags, replace.c_str(), ""); - // now replace /flag - replace[0] = '/'; - cmSystemTools::ReplaceString(flags, replace.c_str(), ""); + // replace the flag + cmSystemTools::ReplaceString(flags, reg.match(1).c_str(), ""); // now put value into flag map flagMap[flagTable->IDEName] = flagTable->value; } @@ -559,6 +558,7 @@ void cmLocalVisualStudio7Generator::FillFlagMapFromCommandFlags( } + void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, const char* configName, const char *libName, -- cgit v0.12