瀏覽代碼

Fix for bug #11274, VS10 custom commands that create files in INTDIR fix.

Bill Hoffman 15 年之前
父節點
當前提交
3d68dd230d
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      Source/cmMakefile.cxx

+ 8 - 0
Source/cmMakefile.cxx

@@ -894,6 +894,14 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
     // Construct a rule file associated with the first output produced.
     std::string outName = outputs[0];
     outName += ".rule";
+    const char* dir =
+      this->LocalGenerator->GetGlobalGenerator()->
+      GetCMakeCFGInitDirectory();
+    if(dir && dir[0] == '$')
+      {
+      cmSystemTools::ReplaceString(outName, dir,
+                                   cmake::GetCMakeFilesDirectory());
+      }
     // Check if the rule file already exists.
     file = this->GetSource(outName.c_str());
     if(file && file->GetCustomCommand() && !replace)