浏览代码

BUG: Error when install dir cannot be created

This teaches the undocumented file(INSTALL) command to report an error
when it cannot create the destination directory.
Brad King 16 年之前
父节点
当前提交
f180a834bf
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Source/cmFileCommand.cxx

+ 4 - 0
Source/cmFileCommand.cxx

@@ -1192,6 +1192,10 @@ bool cmFileInstaller::InstallDirectory(const char* source,
   // Make sure the destination directory exists.
   // Make sure the destination directory exists.
   if(!cmSystemTools::MakeDirectory(destination))
   if(!cmSystemTools::MakeDirectory(destination))
     {
     {
+    cmOStringStream e;
+    e << "INSTALL cannot make directory \"" << destination << "\": "
+      << cmSystemTools::GetLastSystemError();
+    this->FileCommand->SetError(e.str().c_str());
     return false;
     return false;
     }
     }