summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-05-09 14:18:31 (GMT)
committerBrad King <brad.king@kitware.com>2007-05-09 14:18:31 (GMT)
commitadcd87c976eede8e76234550beb89ca082a00ade (patch)
treefaae266121f6b1ffeb2838a2c85318c79e4b516d /Source
parente701ef77d8487c3cf348f24f86fdfd97661681ab (diff)
downloadCMake-adcd87c976eede8e76234550beb89ca082a00ade.zip
CMake-adcd87c976eede8e76234550beb89ca082a00ade.tar.gz
CMake-adcd87c976eede8e76234550beb89ca082a00ade.tar.bz2
BUG: Fixed cmLocalVisualStudio7Generator to deal with quotes in macro definitions properly. This addresses bug#4983.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 6e2f1be..2019b8e 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -502,9 +502,9 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"));
// Add a definition for the configuration name.
- std::string configDefine = "CMAKE_INTDIR=\\\"";
+ std::string configDefine = "CMAKE_INTDIR=\"";
configDefine += configName;
- configDefine += "\\\"";
+ configDefine += "\"";
targetOptions.AddDefine(configDefine);
// Add the export symbol definition for shared library objects.
@@ -1836,14 +1836,13 @@ cmLocalVisualStudio7GeneratorOptions
for(std::vector<cmStdString>::const_iterator di = this->Defines.begin();
di != this->Defines.end(); ++di)
{
- // Escape this flag for the IDE.
- std::string define =
- cmLocalVisualStudio7GeneratorEscapeForXML(di->c_str());
-
- // Old comment:
// Double-quotes in the value of the definition must be escaped
- // with a backslash. The entire definition should be quoted in
- // the generated xml attribute to avoid confusing the VS parser.
+ // with a backslash.
+ std::string define = di->c_str();
+ cmSystemTools::ReplaceString(define, "\"", "\\\"");
+
+ // Escape this flag for the IDE.
+ define = cmLocalVisualStudio7GeneratorEscapeForXML(define.c_str());
// Write this flag. Quote it if the definition is not
// alphanumeric.