From 071725a1c1c419f8d00770364e6345ed300fa5a1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Sat, 10 May 2008 18:39:06 -0400 Subject: [PATCH] BUG: Fix generation of some paths into .cmake files in the build tree to escape strings for the CMake language. This fix allows users to put double quotes in the SOVERSION of a shared library. --- Source/cmLocalUnixMakefileGenerator3.cxx | 4 ++-- Source/cmMakefileTargetGenerator.cxx | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index a717beff2..50921be2b 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1110,8 +1110,8 @@ cmLocalUnixMakefileGenerator3 for(std::vector::const_iterator f = files.begin(); f != files.end(); ++f) { - fout << "\"" << this->Convert(f->c_str(),START_OUTPUT,UNCHANGED) - << "\"\n"; + std::string fc = this->Convert(f->c_str(),START_OUTPUT,UNCHANGED); + fout << " " << this->EscapeForCMake(fc.c_str()) << "\n"; } fout << ")\n"; commands.push_back(remove); diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 6cb5fd00d..3f4b866a3 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -933,8 +933,10 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() this->MultipleOutputPairs.begin(); pi != this->MultipleOutputPairs.end(); ++pi) { - *this->InfoFileStream << " \"" << pi->first << "\" \"" - << pi->second << "\"\n"; + *this->InfoFileStream + << " " << this->LocalGenerator->EscapeForCMake(pi->first.c_str()) + << " " << this->LocalGenerator->EscapeForCMake(pi->second.c_str()) + << "\n"; } *this->InfoFileStream << " )\n\n"; }