Browse Source

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.

Brad King 17 years ago
parent
commit
071725a1c1
2 changed files with 6 additions and 4 deletions
  1. 2 2
      Source/cmLocalUnixMakefileGenerator3.cxx
  2. 4 2
      Source/cmMakefileTargetGenerator.cxx

+ 2 - 2
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -1110,8 +1110,8 @@ cmLocalUnixMakefileGenerator3
     for(std::vector<std::string>::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);

+ 4 - 2
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";
     }