瀏覽代碼

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 年之前
父節點
當前提交
071725a1c1
共有 2 個文件被更改,包括 6 次插入4 次删除
  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();
     for(std::vector<std::string>::const_iterator f = files.begin();
         f != files.end(); ++f)
         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";
     fout << ")\n";
     commands.push_back(remove);
     commands.push_back(remove);

+ 4 - 2
Source/cmMakefileTargetGenerator.cxx

@@ -933,8 +933,10 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
           this->MultipleOutputPairs.begin();
           this->MultipleOutputPairs.begin();
         pi != this->MultipleOutputPairs.end(); ++pi)
         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";
     *this->InfoFileStream << "  )\n\n";
     }
     }