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  f8c5b31f33becfba9f25ca29cc4caee6b343f93c (commit)
       via  d5d8170f3628c867bd14f385de3d5b8b82f01109 (commit)
      from  6ddde7ce0264de27af6a5160695506abb52906e2 (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=f8c5b31f33becfba9f25ca29cc4caee6b343f93c
commit f8c5b31f33becfba9f25ca29cc4caee6b343f93c
Merge: 6ddde7c d5d8170
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Feb 13 13:20:22 2017 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Mon Feb 13 13:20:22 2017 -0500

    Merge topic 'command-cleanup' into next
    
    d5d8170f Revert topic 'command-cleanup'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d5d8170f3628c867bd14f385de3d5b8b82f01109
commit d5d8170f3628c867bd14f385de3d5b8b82f01109
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Feb 13 13:19:59 2017 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Mon Feb 13 13:19:59 2017 -0500

    Revert topic 'command-cleanup'
    
    It will be revised and restored.

diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst
index 611c989..d0c2986 100644
--- a/Help/manual/cmake-commands.7.rst
+++ b/Help/manual/cmake-commands.7.rst
@@ -7,103 +7,91 @@ cmake-commands(7)
 
    .. contents::
 
-Scripting Commands
-==================
+Normal Commands
+===============
 
-These commands are always available.
+These commands may be used freely in CMake projects.
 
 .. toctree::
    :maxdepth: 1
 
+   /command/add_compile_options
+   /command/add_custom_command
+   /command/add_custom_target
+   /command/add_definitions
+   /command/add_dependencies
+   /command/add_executable
+   /command/add_library
+   /command/add_subdirectory
+   /command/add_test
+   /command/aux_source_directory
    /command/break
+   /command/build_command
    /command/cmake_host_system_information
    /command/cmake_minimum_required
    /command/cmake_parse_arguments
    /command/cmake_policy
    /command/configure_file
    /command/continue
+   /command/create_test_sourcelist
+   /command/define_property
    /command/elseif
    /command/else
+   /command/enable_language
+   /command/enable_testing
    /command/endforeach
    /command/endfunction
    /command/endif
    /command/endmacro
    /command/endwhile
    /command/execute_process
+   /command/export
    /command/file
    /command/find_file
    /command/find_library
    /command/find_package
    /command/find_path
    /command/find_program
+   /command/fltk_wrap_ui
    /command/foreach
    /command/function
    /command/get_cmake_property
    /command/get_directory_property
    /command/get_filename_component
    /command/get_property
-   /command/if
-   /command/include
-   /command/list
-   /command/macro
-   /command/mark_as_advanced
-   /command/math
-   /command/message
-   /command/option
-   /command/return
-   /command/separate_arguments
-   /command/set_directory_properties
-   /command/set_property
-   /command/set
-   /command/site_name
-   /command/string
-   /command/unset
-   /command/variable_watch
-   /command/while
-
-Project Commands
-================
-
-These commands are available only in CMake projects.
-
-.. toctree::
-   :maxdepth: 1
-
-   /command/add_compile_options
-   /command/add_custom_command
-   /command/add_custom_target
-   /command/add_definitions
-   /command/add_dependencies
-   /command/add_executable
-   /command/add_library
-   /command/add_subdirectory
-   /command/add_test
-   /command/aux_source_directory
-   /command/build_command
-   /command/create_test_sourcelist
-   /command/define_property
-   /command/enable_language
-   /command/enable_testing
-   /command/export
-   /command/fltk_wrap_ui
    /command/get_source_file_property
    /command/get_target_property
    /command/get_test_property
+   /command/if
    /command/include_directories
    /command/include_external_msproject
    /command/include_regular_expression
+   /command/include
    /command/install
    /command/link_directories
    /command/link_libraries
+   /command/list
    /command/load_cache
+   /command/macro
+   /command/mark_as_advanced
+   /command/math
+   /command/message
+   /command/option
    /command/project
    /command/qt_wrap_cpp
    /command/qt_wrap_ui
    /command/remove_definitions
+   /command/return
+   /command/separate_arguments
+   /command/set_directory_properties
+   /command/set_property
+   /command/set
    /command/set_source_files_properties
    /command/set_target_properties
    /command/set_tests_properties
+   /command/site_name
    /command/source_group
+   /command/string
    /command/target_compile_definitions
    /command/target_compile_features
    /command/target_compile_options
@@ -112,30 +100,9 @@ These commands are available only in CMake projects.
    /command/target_sources
    /command/try_compile
    /command/try_run
-
-.. _`CTest Commands`:
-
-CTest Commands
-==============
-
-These commands are available only in CTest scripts.
-
-.. toctree::
-   :maxdepth: 1
-
-   /command/ctest_build
-   /command/ctest_configure
-   /command/ctest_coverage
-   /command/ctest_empty_binary_directory
-   /command/ctest_memcheck
-   /command/ctest_read_custom_files
-   /command/ctest_run_script
-   /command/ctest_sleep
-   /command/ctest_start
-   /command/ctest_submit
-   /command/ctest_test
-   /command/ctest_update
-   /command/ctest_upload
+   /command/unset
+   /command/variable_watch
+   /command/while
 
 Deprecated Commands
 ===================
@@ -162,3 +129,27 @@ versions of CMake.  Do not use them in new code.
    /command/utility_source
    /command/variable_requires
    /command/write_file
+
+.. _`CTest Commands`:
+
+CTest Commands
+==============
+
+These commands are available only in ctest scripts.
+
+.. toctree::
+   :maxdepth: 1
+
+   /command/ctest_build
+   /command/ctest_configure
+   /command/ctest_coverage
+   /command/ctest_empty_binary_directory
+   /command/ctest_memcheck
+   /command/ctest_read_custom_files
+   /command/ctest_run_script
+   /command/ctest_sleep
+   /command/ctest_start
+   /command/ctest_submit
+   /command/ctest_test
+   /command/ctest_update
+   /command/ctest_upload
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 3b05f4c..2835ee6 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -440,8 +440,6 @@ set(SRCS
   cmCreateTestSourceList.h
   cmDefinePropertyCommand.cxx
   cmDefinePropertyCommand.h
-  cmDeprecatedCommand.cxx
-  cmDeprecatedCommand.h
   cmEnableLanguageCommand.cxx
   cmEnableLanguageCommand.h
   cmEnableTestingCommand.cxx
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx 
b/Source/CTest/cmCTestHandlerCommand.cxx
index 2a67d47..a989b12 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -123,8 +123,8 @@ bool 
cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
     if (capureCMakeError) {
       this->Makefile->AddDefinition(this->Values[ct_CAPTURE_CMAKE_ERROR],
                                     "-1");
-      std::string const err = this->GetName() + " " + this->GetError();
-      if (!cmSystemTools::FindLastString(err.c_str(), "unknown error.")) {
+      const char* err = this->GetError();
+      if (err && !cmSystemTools::FindLastString(err, "unknown error.")) {
         cmCTestLog(this->CTest, ERROR_MESSAGE, err << " error from command\n");
       }
       // return success because failure is recorded in CAPTURE_CMAKE_ERROR
diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx
index 12b69a8..1e1cd21 100644
--- a/Source/cmBuildNameCommand.cxx
+++ b/Source/cmBuildNameCommand.cxx
@@ -16,6 +16,11 @@ class cmExecutionStatus;
 bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args,
                                      cmExecutionStatus&)
 {
+  if (this->Disallowed(
+        cmPolicies::CMP0036,
+        "The build_name command should not be called; see CMP0036.")) {
+    return true;
+  }
   if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
diff --git a/Source/cmCommand.cxx b/Source/cmCommand.cxx
index d349c91..181b412 100644
--- a/Source/cmCommand.cxx
+++ b/Source/cmCommand.cxx
@@ -3,6 +3,7 @@
 #include "cmCommand.h"
 
 #include "cmMakefile.h"
+#include "cmake.h"
 
 class cmExecutionStatus;
 struct cmListFileArgument;
@@ -22,12 +23,32 @@ bool cmCommand::InvokeInitialPass(const 
std::vector<cmListFileArgument>& args,
 const char* cmCommand::GetError()
 {
   if (this->Error.empty()) {
-    return "unknown error.";
+    this->Error = this->GetName();
+    this->Error += " unknown error.";
   }
   return this->Error.c_str();
 }
 
 void cmCommand::SetError(const std::string& e)
 {
-  this->Error = e;
+  this->Error = this->GetName();
+  this->Error += " ";
+  this->Error += e;
+}
+
+bool cmCommand::Disallowed(cmPolicies::PolicyID pol, const char* e)
+{
+  switch (this->Makefile->GetPolicyStatus(pol)) {
+    case cmPolicies::WARN:
+      this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
+                                   cmPolicies::GetPolicyWarning(pol));
+    case cmPolicies::OLD:
+      return false;
+    case cmPolicies::REQUIRED_IF_USED:
+    case cmPolicies::REQUIRED_ALWAYS:
+    case cmPolicies::NEW:
+      this->Makefile->IssueMessage(cmake::FATAL_ERROR, e);
+      break;
+  }
+  return true;
 }
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index 9107d85..d9fd5a2 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -7,6 +7,9 @@
 #include <string>
 #include <vector>
 
+#include "cmCommandArgumentsHelper.h"
+#include "cmPolicies.h"
+
 class cmExecutionStatus;
 class cmMakefile;
 struct cmListFileArgument;
@@ -102,12 +105,12 @@ public:
    */
   void SetError(const std::string& e);
 
-private:
-  cmCommand(cmCommand const&);            // = delete;
-  cmCommand& operator=(cmCommand const&); // = delete;
+  /** Check if the command is disallowed by a policy.  */
+  bool Disallowed(cmPolicies::PolicyID pol, const char* e);
 
 protected:
   cmMakefile* Makefile;
+  cmCommandArgumentsHelper Helper;
 
 private:
   std::string Error;
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index 9ff395a..4c5b093 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -1,7 +1,6 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmCommands.h"
-#include "cmState.h"
 
 #include "cmAddCustomCommandCommand.h"
 #include "cmAddCustomTargetCommand.h"
@@ -78,7 +77,6 @@
 #include "cmAuxSourceDirectoryCommand.h"
 #include "cmBuildNameCommand.h"
 #include "cmCMakeHostSystemInformationCommand.h"
-#include "cmDeprecatedCommand.h"
 #include "cmExportCommand.h"
 #include "cmExportLibraryDependenciesCommand.h"
 #include "cmFLTKWrapUICommand.h"
@@ -106,162 +104,138 @@
 #include "cmWriteFileCommand.h"
 #endif
 
-void GetScriptingCommands(cmState* state)
+std::vector<cmCommand*> GetPredefinedCommands()
 {
-  state->AddCommand(new cmBreakCommand);
-  state->AddCommand(new cmCMakeMinimumRequired);
-  state->AddCommand(new cmCMakePolicyCommand);
-  state->AddCommand(new cmConfigureFileCommand);
-  state->AddCommand(new cmContinueCommand);
-  state->AddCommand(new cmExecProgramCommand);
-  state->AddCommand(new cmExecuteProcessCommand);
-  state->AddCommand(new cmFileCommand);
-  state->AddCommand(new cmFindFileCommand);
-  state->AddCommand(new cmFindLibraryCommand);
-  state->AddCommand(new cmFindPackageCommand);
-  state->AddCommand(new cmFindPathCommand);
-  state->AddCommand(new cmFindProgramCommand);
-  state->AddCommand(new cmForEachCommand);
-  state->AddCommand(new cmFunctionCommand);
-  state->AddCommand(new cmGetCMakePropertyCommand);
-  state->AddCommand(new cmGetDirectoryPropertyCommand);
-  state->AddCommand(new cmGetFilenameComponentCommand);
-  state->AddCommand(new cmGetPropertyCommand);
-  state->AddCommand(new cmIfCommand);
-  state->AddCommand(new cmIncludeCommand);
-  state->AddCommand(new cmListCommand);
-  state->AddCommand(new cmMacroCommand);
-  state->AddCommand(new cmMakeDirectoryCommand);
-  state->AddCommand(new cmMarkAsAdvancedCommand);
-  state->AddCommand(new cmMathCommand);
-  state->AddCommand(new cmMessageCommand);
-  state->AddCommand(new cmOptionCommand);
-  state->AddCommand(new cmParseArgumentsCommand);
-  state->AddCommand(new cmReturnCommand);
-  state->AddCommand(new cmSeparateArgumentsCommand);
-  state->AddCommand(new cmSetCommand);
-  state->AddCommand(new cmSetDirectoryPropertiesCommand);
-  state->AddCommand(new cmSetPropertyCommand);
-  state->AddCommand(new cmSiteNameCommand);
-  state->AddCommand(new cmStringCommand);
-  state->AddCommand(new cmUnsetCommand);
-  state->AddCommand(new cmWhileCommand);
+  std::vector<cmCommand*> commands;
 
-  state->AddCommand(new cmUnexpectedCommand(
+  commands.push_back(new cmAddCustomCommandCommand);
+  commands.push_back(new cmAddCustomTargetCommand);
+  commands.push_back(new cmAddDefinitionsCommand);
+  commands.push_back(new cmAddDependenciesCommand);
+  commands.push_back(new cmAddExecutableCommand);
+  commands.push_back(new cmAddLibraryCommand);
+  commands.push_back(new cmAddSubDirectoryCommand);
+  commands.push_back(new cmAddTestCommand);
+  commands.push_back(new cmBreakCommand);
+  commands.push_back(new cmBuildCommand);
+  commands.push_back(new cmCMakeMinimumRequired);
+  commands.push_back(new cmCMakePolicyCommand);
+  commands.push_back(new cmConfigureFileCommand);
+  commands.push_back(new cmContinueCommand);
+  commands.push_back(new cmCreateTestSourceList);
+  commands.push_back(new cmDefinePropertyCommand);
+  commands.push_back(new cmEnableLanguageCommand);
+  commands.push_back(new cmEnableTestingCommand);
+  commands.push_back(new cmExecProgramCommand);
+  commands.push_back(new cmExecuteProcessCommand);
+  commands.push_back(new cmFileCommand);
+  commands.push_back(new cmFindFileCommand);
+  commands.push_back(new cmFindLibraryCommand);
+  commands.push_back(new cmFindPackageCommand);
+  commands.push_back(new cmFindPathCommand);
+  commands.push_back(new cmFindProgramCommand);
+  commands.push_back(new cmForEachCommand);
+  commands.push_back(new cmFunctionCommand);
+  commands.push_back(new cmGetCMakePropertyCommand);
+  commands.push_back(new cmGetDirectoryPropertyCommand);
+  commands.push_back(new cmGetFilenameComponentCommand);
+  commands.push_back(new cmGetPropertyCommand);
+  commands.push_back(new cmGetSourceFilePropertyCommand);
+  commands.push_back(new cmGetTargetPropertyCommand);
+  commands.push_back(new cmGetTestPropertyCommand);
+  commands.push_back(new cmIfCommand);
+  commands.push_back(new cmIncludeCommand);
+  commands.push_back(new cmIncludeDirectoryCommand);
+  commands.push_back(new cmIncludeRegularExpressionCommand);
+  commands.push_back(new cmInstallCommand);
+  commands.push_back(new cmInstallFilesCommand);
+  commands.push_back(new cmInstallTargetsCommand);
+  commands.push_back(new cmLinkDirectoriesCommand);
+  commands.push_back(new cmListCommand);
+  commands.push_back(new cmMacroCommand);
+  commands.push_back(new cmMakeDirectoryCommand);
+  commands.push_back(new cmMarkAsAdvancedCommand);
+  commands.push_back(new cmMathCommand);
+  commands.push_back(new cmMessageCommand);
+  commands.push_back(new cmOptionCommand);
+  commands.push_back(new cmParseArgumentsCommand);
+  commands.push_back(new cmProjectCommand);
+  commands.push_back(new cmReturnCommand);
+  commands.push_back(new cmSeparateArgumentsCommand);
+  commands.push_back(new cmSetCommand);
+  commands.push_back(new cmSetDirectoryPropertiesCommand);
+  commands.push_back(new cmSetPropertyCommand);
+  commands.push_back(new cmSetSourceFilesPropertiesCommand);
+  commands.push_back(new cmSetTargetPropertiesCommand);
+  commands.push_back(new cmSetTestsPropertiesCommand);
+  commands.push_back(new cmSiteNameCommand);
+  commands.push_back(new cmStringCommand);
+  commands.push_back(new cmSubdirCommand);
+  commands.push_back(new cmTargetLinkLibrariesCommand);
+  commands.push_back(new cmTryCompileCommand);
+  commands.push_back(new cmTryRunCommand);
+  commands.push_back(new cmUnsetCommand);
+  commands.push_back(new cmWhileCommand);
+
+  commands.push_back(new cmUnexpectedCommand(
     "else", "An ELSE command was found outside of a proper "
             "IF ENDIF structure. Or its arguments did not match "
             "the opening IF command."));
-  state->AddCommand(new cmUnexpectedCommand(
+  commands.push_back(new cmUnexpectedCommand(
     "elseif", "An ELSEIF command was found outside of a proper "
               "IF ENDIF structure."));
-  state->AddCommand(new cmUnexpectedCommand(
+  commands.push_back(new cmUnexpectedCommand(
     "endforeach", "An ENDFOREACH command was found outside of a proper "
                   "FOREACH ENDFOREACH structure. Or its arguments did "
                   "not match the opening FOREACH command."));
-  state->AddCommand(new cmUnexpectedCommand(
+  commands.push_back(new cmUnexpectedCommand(
     "endfunction", "An ENDFUNCTION command was found outside of a proper "
                    "FUNCTION ENDFUNCTION structure. Or its arguments did not "
                    "match the opening FUNCTION command."));
-  state->AddCommand(new cmUnexpectedCommand(
+  commands.push_back(new cmUnexpectedCommand(
     "endif", "An ENDIF command was found outside of a proper "
              "IF ENDIF structure. Or its arguments did not match "
              "the opening IF command."));
-  state->AddCommand(new cmUnexpectedCommand(
+  commands.push_back(new cmUnexpectedCommand(
     "endmacro", "An ENDMACRO command was found outside of a proper "
                 "MACRO ENDMACRO structure. Or its arguments did not "
                 "match the opening MACRO command."));
-  state->AddCommand(new cmUnexpectedCommand(
+  commands.push_back(new cmUnexpectedCommand(
     "endwhile", "An ENDWHILE command was found outside of a proper "
                 "WHILE ENDWHILE structure. Or its arguments did not "
                 "match the opening WHILE command."));
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
-  state->AddCommand(new cmCMakeHostSystemInformationCommand);
-  state->AddCommand(new cmRemoveCommand);
-  state->AddCommand(new cmVariableWatchCommand);
-  state->AddCommand(new cmWriteFileCommand);
-
-  state->AddCommand(new cmDeprecatedCommand(
-    new cmBuildNameCommand, cmPolicies::CMP0036,
-    "The build_name command should not be called; see CMP0036."));
-  state->AddCommand(new cmDeprecatedCommand(
-    new cmUseMangledMesaCommand, cmPolicies::CMP0030,
-    "The use_mangled_mesa command should not be called; see CMP0030."));
-
+  commands.push_back(new cmAddCompileOptionsCommand);
+  commands.push_back(new cmAuxSourceDirectoryCommand);
+  commands.push_back(new cmBuildNameCommand);
+  commands.push_back(new cmCMakeHostSystemInformationCommand);
+  commands.push_back(new cmExportCommand);
+  commands.push_back(new cmExportLibraryDependenciesCommand);
+  commands.push_back(new cmFLTKWrapUICommand);
+  commands.push_back(new cmIncludeExternalMSProjectCommand);
+  commands.push_back(new cmInstallProgramsCommand);
+  commands.push_back(new cmLinkLibrariesCommand);
+  commands.push_back(new cmLoadCacheCommand);
+  commands.push_back(new cmLoadCommandCommand);
+  commands.push_back(new cmOutputRequiredFilesCommand);
+  commands.push_back(new cmQTWrapCPPCommand);
+  commands.push_back(new cmQTWrapUICommand);
+  commands.push_back(new cmRemoveCommand);
+  commands.push_back(new cmRemoveDefinitionsCommand);
+  commands.push_back(new cmSourceGroupCommand);
+  commands.push_back(new cmSubdirDependsCommand);
+  commands.push_back(new cmTargetCompileDefinitionsCommand);
+  commands.push_back(new cmTargetCompileFeaturesCommand);
+  commands.push_back(new cmTargetCompileOptionsCommand);
+  commands.push_back(new cmTargetIncludeDirectoriesCommand);
+  commands.push_back(new cmTargetSourcesCommand);
+  commands.push_back(new cmUseMangledMesaCommand);
+  commands.push_back(new cmUtilitySourceCommand);
+  commands.push_back(new cmVariableRequiresCommand);
+  commands.push_back(new cmVariableWatchCommand);
+  commands.push_back(new cmWriteFileCommand);
 #endif
-}
 
-void GetProjectCommands(cmState* state)
-{
-  state->AddCommand(new cmAddCustomCommandCommand);
-  state->AddCommand(new cmAddCustomTargetCommand);
-  state->AddCommand(new cmAddDefinitionsCommand);
-  state->AddCommand(new cmAddDependenciesCommand);
-  state->AddCommand(new cmAddExecutableCommand);
-  state->AddCommand(new cmAddLibraryCommand);
-  state->AddCommand(new cmAddSubDirectoryCommand);
-  state->AddCommand(new cmAddTestCommand);
-  state->AddCommand(new cmBuildCommand);
-  state->AddCommand(new cmCreateTestSourceList);
-  state->AddCommand(new cmDefinePropertyCommand);
-  state->AddCommand(new cmEnableLanguageCommand);
-  state->AddCommand(new cmEnableTestingCommand);
-  state->AddCommand(new cmGetSourceFilePropertyCommand);
-  state->AddCommand(new cmGetTargetPropertyCommand);
-  state->AddCommand(new cmGetTestPropertyCommand);
-  state->AddCommand(new cmIncludeDirectoryCommand);
-  state->AddCommand(new cmIncludeRegularExpressionCommand);
-  state->AddCommand(new cmInstallCommand);
-  state->AddCommand(new cmInstallFilesCommand);
-  state->AddCommand(new cmInstallTargetsCommand);
-  state->AddCommand(new cmLinkDirectoriesCommand);
-  state->AddCommand(new cmProjectCommand);
-  state->AddCommand(new cmSetSourceFilesPropertiesCommand);
-  state->AddCommand(new cmSetTargetPropertiesCommand);
-  state->AddCommand(new cmSetTestsPropertiesCommand);
-  state->AddCommand(new cmSubdirCommand);
-  state->AddCommand(new cmTargetLinkLibrariesCommand);
-  state->AddCommand(new cmTryCompileCommand);
-  state->AddCommand(new cmTryRunCommand);
-
-#if defined(CMAKE_BUILD_WITH_CMAKE)
-  state->AddCommand(new cmAddCompileOptionsCommand);
-  state->AddCommand(new cmAuxSourceDirectoryCommand);
-  state->AddCommand(new cmExportCommand);
-  state->AddCommand(new cmFLTKWrapUICommand);
-  state->AddCommand(new cmIncludeExternalMSProjectCommand);
-  state->AddCommand(new cmInstallProgramsCommand);
-  state->AddCommand(new cmLinkLibrariesCommand);
-  state->AddCommand(new cmLoadCacheCommand);
-  state->AddCommand(new cmQTWrapCPPCommand);
-  state->AddCommand(new cmQTWrapUICommand);
-  state->AddCommand(new cmRemoveDefinitionsCommand);
-  state->AddCommand(new cmSourceGroupCommand);
-  state->AddCommand(new cmTargetCompileDefinitionsCommand);
-  state->AddCommand(new cmTargetCompileFeaturesCommand);
-  state->AddCommand(new cmTargetCompileOptionsCommand);
-  state->AddCommand(new cmTargetIncludeDirectoriesCommand);
-  state->AddCommand(new cmTargetSourcesCommand);
-
-  state->AddCommand(new cmDeprecatedCommand(
-    new cmExportLibraryDependenciesCommand, cmPolicies::CMP0033,
-    "The export_library_dependencies command should not be called; "
-    "see CMP0033."));
-  state->AddCommand(new cmDeprecatedCommand(
-    new cmLoadCommandCommand, cmPolicies::CMP0031,
-    "The load_command command should not be called; see CMP0031."));
-  state->AddCommand(new cmDeprecatedCommand(
-    new cmOutputRequiredFilesCommand, cmPolicies::CMP0032,
-    "The output_required_files command should not be called; "
-    "see CMP0032."));
-  state->AddCommand(new cmDeprecatedCommand(
-    new cmSubdirDependsCommand, cmPolicies::CMP0029,
-    "The subdir_depends command should not be called; see CMP0029."));
-  state->AddCommand(new cmDeprecatedCommand(
-    new cmUtilitySourceCommand, cmPolicies::CMP0034,
-    "The utility_source command should not be called; see CMP0034."));
-  state->AddCommand(new cmDeprecatedCommand(
-    new cmVariableRequiresCommand, cmPolicies::CMP0035,
-    "The variable_requires command should not be called; see CMP0035."));
-#endif
+  return commands;
 }
diff --git a/Source/cmCommands.h b/Source/cmCommands.h
index 7895ece..649dea6 100644
--- a/Source/cmCommands.h
+++ b/Source/cmCommands.h
@@ -3,14 +3,16 @@
 #ifndef cmCommands_h
 #define cmCommands_h
 
-class cmState;
+#include <cmConfigure.h> // IWYU pragma: keep
 
+#include <vector>
+
+class cmCommand;
 /**
- * Global function to register all compiled in commands.
+ * Global function to return all compiled in commands.
  * To add a new command edit cmCommands.cxx and add your command.
  * It is up to the caller to delete the commands created by this call.
  */
-void GetScriptingCommands(cmState* state);
-void GetProjectCommands(cmState* state);
+std::vector<cmCommand*> GetPredefinedCommands();
 
 #endif
diff --git a/Source/cmDeprecatedCommand.cxx b/Source/cmDeprecatedCommand.cxx
deleted file mode 100644
index cd0c7ab..0000000
--- a/Source/cmDeprecatedCommand.cxx
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file Copyright.txt or https://cmake.org/licensing for details.  */
-#include "cmDeprecatedCommand.h"
-
-#include "cmMakefile.h"
-#include "cmake.h"
-
-class cmExecutionStatus;
-
-bool cmDeprecatedCommand::InitialPass(std::vector<std::string> const& args,
-                                      cmExecutionStatus& status)
-{
-  switch (this->Makefile->GetPolicyStatus(this->Policy)) {
-    case cmPolicies::WARN:
-      this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
-                                   cmPolicies::GetPolicyWarning(this->Policy));
-      break;
-    case cmPolicies::OLD:
-      break;
-    case cmPolicies::REQUIRED_IF_USED:
-    case cmPolicies::REQUIRED_ALWAYS:
-    case cmPolicies::NEW:
-      this->Makefile->IssueMessage(cmake::FATAL_ERROR, this->Message);
-      return true;
-  }
-
-  this->Command->SetMakefile(this->GetMakefile());
-  bool const ret = this->Command->InitialPass(args, status);
-  this->SetError(this->Command->GetError());
-  return ret;
-}
diff --git a/Source/cmDeprecatedCommand.h b/Source/cmDeprecatedCommand.h
deleted file mode 100644
index 7424fbc..0000000
--- a/Source/cmDeprecatedCommand.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file Copyright.txt or https://cmake.org/licensing for details.  */
-#ifndef cmDeprecatedCommand_h
-#define cmDeprecatedCommand_h
-
-#include <cmConfigure.h>
-#include <string>
-#include <vector>
-
-#include "cmCommand.h"
-#include "cmPolicies.h"
-
-class cmExecutionStatus;
-
-class cmDeprecatedCommand : public cmCommand
-{
-public:
-  cmDeprecatedCommand(cmCommand* command, cmPolicies::PolicyID policy,
-                      const char* message)
-    : Command(command)
-    , Policy(policy)
-    , Message(message)
-  {
-  }
-
-  ~cmDeprecatedCommand() { delete this->Command; }
-
-  cmCommand* Clone() CM_OVERRIDE
-  {
-    return new cmDeprecatedCommand(this->Command->Clone(), this->Policy,
-                                   this->Message);
-  }
-
-  bool InitialPass(std::vector<std::string> const& args,
-                   cmExecutionStatus& status) CM_OVERRIDE;
-
-  bool IsScriptable() const CM_OVERRIDE
-  {
-    return this->Command->IsScriptable();
-  }
-
-  std::string GetName() const CM_OVERRIDE { return this->Command->GetName(); }
-
-private:
-  cmCommand* Command;
-  cmPolicies::PolicyID Policy;
-  const char* Message;
-};
-
-#endif
diff --git a/Source/cmExportCommand.h b/Source/cmExportCommand.h
index a0224d0..99dac7d 100644
--- a/Source/cmExportCommand.h
+++ b/Source/cmExportCommand.h
@@ -41,7 +41,6 @@ public:
   std::string GetName() const CM_OVERRIDE { return "export"; }
 
 private:
-  cmCommandArgumentsHelper Helper;
   cmCommandArgumentGroup ArgumentGroup;
   cmCAStringVector Targets;
   cmCAEnabler Append;
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx 
b/Source/cmExportLibraryDependenciesCommand.cxx
index e3fb412..ac4f040 100644
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
@@ -23,6 +23,12 @@ class cmExecutionStatus;
 bool cmExportLibraryDependenciesCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {
+  if (this->Disallowed(
+        cmPolicies::CMP0033,
+        "The export_library_dependencies command should not be called; "
+        "see CMP0033.")) {
+    return true;
+  }
   if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
index 39e5684..b6743f1 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -174,6 +174,11 @@ cmLoadedCommand::~cmLoadedCommand()
 bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& args,
                                        cmExecutionStatus&)
 {
+  if (this->Disallowed(
+        cmPolicies::CMP0031,
+        "The load_command command should not be called; see CMP0031.")) {
+    return true;
+  }
   if (args.empty()) {
     return true;
   }
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 4520c8e..bfe46ae 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -281,8 +281,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& 
lff,
       if (!invokeSucceeded || hadNestedError) {
         if (!hadNestedError) {
           // The command invocation requested that we report an error.
-          std::string const error = name + " " + pcmd->GetError();
-          this->IssueMessage(cmake::FATAL_ERROR, error.c_str());
+          this->IssueMessage(cmake::FATAL_ERROR, pcmd->GetError());
         }
         result = false;
         if (this->GetCMakeInstance()->GetWorkingMode() != cmake::NORMAL_MODE) {
diff --git a/Source/cmOutputRequiredFilesCommand.cxx 
b/Source/cmOutputRequiredFilesCommand.cxx
index f120971..7a17f2c 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -495,6 +495,11 @@ protected:
 bool cmOutputRequiredFilesCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {
+  if (this->Disallowed(cmPolicies::CMP0032, "The output_required_files "
+                                            "command should not be called; "
+                                            "see CMP0032.")) {
+    return true;
+  }
   if (args.size() != 2) {
     this->SetError("called with incorrect number of arguments");
     return false;
diff --git a/Source/cmSubdirDependsCommand.cxx 
b/Source/cmSubdirDependsCommand.cxx
index 36e84d5..9259836 100644
--- a/Source/cmSubdirDependsCommand.cxx
+++ b/Source/cmSubdirDependsCommand.cxx
@@ -9,5 +9,8 @@ class cmExecutionStatus;
 bool cmSubdirDependsCommand::InitialPass(std::vector<std::string> const&,
                                          cmExecutionStatus&)
 {
+  this->Disallowed(
+    cmPolicies::CMP0029,
+    "The subdir_depends command should not be called; see CMP0029.");
   return true;
 }
diff --git a/Source/cmUseMangledMesaCommand.cxx 
b/Source/cmUseMangledMesaCommand.cxx
index 3d57f0e..3e72d75 100644
--- a/Source/cmUseMangledMesaCommand.cxx
+++ b/Source/cmUseMangledMesaCommand.cxx
@@ -13,6 +13,11 @@ class cmExecutionStatus;
 bool cmUseMangledMesaCommand::InitialPass(std::vector<std::string> const& args,
                                           cmExecutionStatus&)
 {
+  if (this->Disallowed(
+        cmPolicies::CMP0030,
+        "The use_mangled_mesa command should not be called; see CMP0030.")) {
+    return true;
+  }
   // expected two arguments:
   // arguement one: the full path to gl_mangle.h
   // arguement two : directory for output of edited headers
diff --git a/Source/cmUtilitySourceCommand.cxx 
b/Source/cmUtilitySourceCommand.cxx
index 9b24a74..3b78abe 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -16,6 +16,11 @@ class cmExecutionStatus;
 bool cmUtilitySourceCommand::InitialPass(std::vector<std::string> const& args,
                                          cmExecutionStatus&)
 {
+  if (this->Disallowed(
+        cmPolicies::CMP0034,
+        "The utility_source command should not be called; see CMP0034.")) {
+    return true;
+  }
   if (args.size() < 3) {
     this->SetError("called with incorrect number of arguments");
     return false;
diff --git a/Source/cmVariableRequiresCommand.cxx 
b/Source/cmVariableRequiresCommand.cxx
index bff6ec5..1eb1f20 100644
--- a/Source/cmVariableRequiresCommand.cxx
+++ b/Source/cmVariableRequiresCommand.cxx
@@ -13,6 +13,11 @@ class cmExecutionStatus;
 bool cmVariableRequiresCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {
+  if (this->Disallowed(
+        cmPolicies::CMP0035,
+        "The variable_requires command should not be called; see CMP0035.")) {
+    return true;
+  }
   if (args.size() < 3) {
     this->SetError("called with incorrect number of arguments");
     return false;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index b2384cd..6141f50 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -120,6 +120,8 @@
 #include <string.h>
 #include <utility>
 
+class cmCommand;
+
 namespace {
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -177,8 +179,7 @@ cmake::cmake()
 
   this->AddDefaultGenerators();
   this->AddDefaultExtraGenerators();
-  this->AddScriptingCommands();
-  this->AddProjectCommands();
+  this->AddDefaultCommands();
 
   // Make sure we can capture the build tool output.
   cmSystemTools::EnableVSConsoleOutput();
@@ -1653,14 +1654,13 @@ const char* cmake::GetCacheDefinition(const 
std::string& name) const
   return this->State->GetInitializedCacheValue(name);
 }
 
-void cmake::AddScriptingCommands()
+void cmake::AddDefaultCommands()
 {
-  GetScriptingCommands(this->State);
-}
-
-void cmake::AddProjectCommands()
-{
-  GetProjectCommands(this->State);
+  std::vector<cmCommand*> const commands = GetPredefinedCommands();
+  for (std::vector<cmCommand*>::const_iterator i = commands.begin();
+       i != commands.end(); ++i) {
+    this->State->AddCommand(*i);
+  }
 }
 
 void cmake::AddDefaultGenerators()
diff --git a/Source/cmake.h b/Source/cmake.h
index abb13ac..5347745 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -425,8 +425,7 @@ protected:
   typedef std::vector<cmExternalMakefileProjectGeneratorFactory*>
     RegisteredExtraGeneratorsVector;
   RegisteredExtraGeneratorsVector ExtraGenerators;
-  void AddScriptingCommands();
-  void AddProjectCommands();
+  void AddDefaultCommands();
   void AddDefaultGenerators();
   void AddDefaultExtraGenerators();
 

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

Summary of changes:
 Help/manual/cmake-commands.7.rst              |  133 +++++++-------
 Source/CMakeLists.txt                         |    2 -
 Source/CTest/cmCTestHandlerCommand.cxx        |    4 +-
 Source/cmBuildNameCommand.cxx                 |    5 +
 Source/cmCommand.cxx                          |   25 ++-
 Source/cmCommand.h                            |    9 +-
 Source/cmCommands.cxx                         |  242 +++++++++++--------------
 Source/cmCommands.h                           |   10 +-
 Source/cmDeprecatedCommand.cxx                |   31 ----
 Source/cmDeprecatedCommand.h                  |   50 -----
 Source/cmExportCommand.h                      |    1 -
 Source/cmExportLibraryDependenciesCommand.cxx |    6 +
 Source/cmLoadCommandCommand.cxx               |    5 +
 Source/cmMakefile.cxx                         |    3 +-
 Source/cmOutputRequiredFilesCommand.cxx       |    5 +
 Source/cmSubdirDependsCommand.cxx             |    3 +
 Source/cmUseMangledMesaCommand.cxx            |    5 +
 Source/cmUtilitySourceCommand.cxx             |    5 +
 Source/cmVariableRequiresCommand.cxx          |    5 +
 Source/cmake.cxx                              |   18 +-
 Source/cmake.h                                |    3 +-
 21 files changed, 257 insertions(+), 313 deletions(-)
 delete mode 100644 Source/cmDeprecatedCommand.cxx
 delete mode 100644 Source/cmDeprecatedCommand.h


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to