浏览代码

ENH: add -B option to specify the build directory, so make edit_cache will work

Bill Hoffman 23 年之前
父节点
当前提交
2caeffcb20
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      Source/CursesDialog/ccmake.cxx

+ 6 - 1
Source/CursesDialog/ccmake.cxx

@@ -71,9 +71,14 @@ int main(int argc, char** argv)
       }
       }
     }
     }
 
 
+  std::string cacheDir = cmSystemTools::GetCurrentWorkingDirectory();
   for(i=1; i < args.size(); ++i)
   for(i=1; i < args.size(); ++i)
     {
     {
     std::string arg = args[i];
     std::string arg = args[i];
+    if(arg.find("-B",0) == 0)
+      {
+      cacheDir = arg.substr(2);
+      }
     if(arg.find("-help",0) != std::string::npos ||
     if(arg.find("-help",0) != std::string::npos ||
        arg.find("--help",0) != std::string::npos ||
        arg.find("--help",0) != std::string::npos ||
        arg.find("/?",0) != std::string::npos ||
        arg.find("/?",0) != std::string::npos ||
@@ -86,7 +91,7 @@ int main(int argc, char** argv)
 
 
   cmSystemTools::DisableRunCommandOutput();
   cmSystemTools::DisableRunCommandOutput();
 
 
-  cmCacheManager::GetInstance()->LoadCache(cmSystemTools::GetCurrentWorkingDirectory().c_str());
+  cmCacheManager::GetInstance()->LoadCache(cacheDir.c_str());
 
 
   if (debug)
   if (debug)
     {
     {