[Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-685-g4f86336

Brad King brad.king at kitware.com
Mon Oct 24 10:04:42 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  4f8633666382e9b518a5af001146c9f8abfb9844 (commit)
       via  9af394a2ce6f0815323e9213784494b225bc2a6f (commit)
      from  4df5915b50c57b3f028cb3fb7555c42384bd34e8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4f8633666382e9b518a5af001146c9f8abfb9844
commit 4f8633666382e9b518a5af001146c9f8abfb9844
Merge: 4df5915 9af394a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 24 10:04:41 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Oct 24 10:04:41 2016 -0400

    Merge topic 'cmcommand-no-disable' into next
    
    9af394a2 Revert topic 'cmcommand-no-disable'

diff --cc Source/cmCommand.h
index b263a61,9299c71..65bb7c5
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@@ -19,11 -19,13 +19,11 @@@
   * to support such features as enable/disable, inheritance,
   * documentation, and construction.
   */
 -class cmCommand : public cmObject
 +class cmCommand
  {
  public:
 -  cmTypeMacro(cmCommand, cmObject);
 -
    /**
-    * Construct the command. By default it has no makefile.
+    * Construct the command. By default it is enabled with no makefile.
     */
    cmCommand()
      : Makefile(CM_NULLPTR)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9af394a2ce6f0815323e9213784494b225bc2a6f
commit 9af394a2ce6f0815323e9213784494b225bc2a6f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 24 10:03:15 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 24 10:03:15 2016 -0400

    Revert topic 'cmcommand-no-disable'
    
    It will be rebased and restored to avoid conflicts.

diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index 5adca64..9299c71 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -25,10 +25,11 @@ public:
   cmTypeMacro(cmCommand, cmObject);
 
   /**
-   * Construct the command. By default it has no makefile.
+   * Construct the command. By default it is enabled with no makefile.
    */
   cmCommand()
     : Makefile(CM_NULLPTR)
+    , Enabled(true)
   {
   }
 
@@ -95,6 +96,26 @@ public:
   virtual std::string GetName() const = 0;
 
   /**
+   * Enable the command.
+   */
+  void EnabledOn() { this->Enabled = true; }
+
+  /**
+   * Disable the command.
+   */
+  void EnabledOff() { this->Enabled = false; }
+
+  /**
+   * Query whether the command is enabled.
+   */
+  bool GetEnabled() const { return this->Enabled; }
+
+  /**
+   * Disable or enable the command.
+   */
+  void SetEnabled(bool enabled) { this->Enabled = enabled; }
+
+  /**
    * Return the last error string.
    */
   const char* GetError();
@@ -112,6 +133,7 @@ protected:
   cmCommandArgumentsHelper Helper;
 
 private:
+  bool Enabled;
   std::string Error;
 };
 
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 741ffb8..00c0e82 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -266,7 +266,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
     pcmd->SetMakefile(this);
 
     // Decide whether to invoke the command.
-    if (!cmSystemTools::GetFatalErrorOccured() &&
+    if (pcmd->GetEnabled() && !cmSystemTools::GetFatalErrorOccured() &&
         (this->GetCMakeInstance()->GetWorkingMode() != cmake::SCRIPT_MODE ||
          pcmd->IsScriptable()))
 

-----------------------------------------------------------------------

Summary of changes:
 Source/cmCommand.h    |   24 +++++++++++++++++++++++-
 Source/cmMakefile.cxx |    2 +-
 2 files changed, 24 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list