浏览代码

ENH: Add additional optional argument to Run. If it is true, it will only set paths and load cache. It will not do configure and gfenerate

Andy Cedilnik 22 年之前
父节点
当前提交
e72535fda7
共有 2 个文件被更改,包括 9 次插入2 次删除
  1. 6 1
      Source/cmake.cxx
  2. 3 1
      Source/cmake.h

+ 6 - 1
Source/cmake.cxx

@@ -909,7 +909,7 @@ bool cmake::CacheVersionMatches()
 }
 }
 
 
 // handle a command line invocation
 // handle a command line invocation
-int cmake::Run(const std::vector<std::string>& args)
+int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
 {
 {
   // Process the arguments
   // Process the arguments
   this->SetArgs(args);
   this->SetArgs(args);
@@ -941,6 +941,11 @@ int cmake::Run(const std::vector<std::string>& args)
   std::string systemFile = this->GetHomeOutputDirectory();
   std::string systemFile = this->GetHomeOutputDirectory();
   systemFile += "/CMakeSystem.cmake";
   systemFile += "/CMakeSystem.cmake";
 
 
+  if ( noconfigure )
+    {
+    return 0;
+    }
+
   int ret = 0;
   int ret = 0;
   // if not local or the cmake version has changed since the last run
   // if not local or the cmake version has changed since the last run
   // of cmake, or CMakeSystem.cmake file is not in the root binary
   // of cmake, or CMakeSystem.cmake file is not in the root binary

+ 3 - 1
Source/cmake.h

@@ -119,7 +119,9 @@ class cmake
   /**
   /**
    * Handle a command line invocation of cmake.
    * Handle a command line invocation of cmake.
    */
    */
-  int Run(const std::vector<std::string>&args);
+  int Run(const std::vector<std::string>&args)
+    { this->Run(args, false); }
+  int Run(const std::vector<std::string>&args, bool noconfigure);
 
 
   /**
   /**
    * Generate the SourceFilesList from the SourceLists. This should only be
    * Generate the SourceFilesList from the SourceLists. This should only be