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  d358f8bba5418d0a8e95bd5efe0a913b8acb2a13 (commit)
       via  e0f3931226d6f947572bce7a4b98c55812bba105 (commit)
       via  72dcbbe5c017a4c071187259f9594ccf02f7b466 (commit)
       via  7fb14775a3cce73dc0cb0d759b96059a95f7104b (commit)
       via  615e2a17e499b2bd53cce8da1a0cfae36d67b24a (commit)
       via  45b49099d9dd034fd1e7344b3bae88b0e3d3427a (commit)
       via  5396bc92d0162fa9a9462e15ccaae8764da8ff98 (commit)
      from  d8aec3f2d5478ffb7235b638d33d08e944093916 (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=d358f8bba5418d0a8e95bd5efe0a913b8acb2a13
commit d358f8bba5418d0a8e95bd5efe0a913b8acb2a13
Merge: d8aec3f e0f3931
Author:     Daniel Pfeifer <dan...@pfeifer-mail.de>
AuthorDate: Mon Feb 13 17:29:12 2017 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Mon Feb 13 17:29:12 2017 -0500

    Merge topic 'command-cleanup' into next
    
    e0f39312 cmCommands: add commands directly to cmState
    72dcbbe5 split Default commands into Scripting and Project
    7fb14775 cmDisallowedCommand: extract policy checking from cmCommand
    615e2a17 cmCommand: Don't prefix error message with command name
    45b49099 cmCommand: make noncopyable
    5396bc92 cmCommand: remove member Helper


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0f3931226d6f947572bce7a4b98c55812bba105
commit e0f3931226d6f947572bce7a4b98c55812bba105
Author:     Daniel Pfeifer <dan...@pfeifer-mail.de>
AuthorDate: Fri Jan 20 22:40:16 2017 +0100
Commit:     Daniel Pfeifer <dan...@pfeifer-mail.de>
CommitDate: Mon Feb 13 22:39:20 2017 +0100

    cmCommands: add commands directly to cmState

diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index 64cd12e..b58dc62 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -1,6 +1,7 @@
 /* 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"
@@ -105,170 +106,162 @@
 #include "cmWriteFileCommand.h"
 #endif
 
-std::vector<cmCommand*> GetScriptingCommands()
+void GetScriptingCommands(cmState* state)
 {
-  std::vector<cmCommand*> commands;
+  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);
 
-  commands.push_back(new cmBreakCommand);
-  commands.push_back(new cmCMakeMinimumRequired);
-  commands.push_back(new cmCMakePolicyCommand);
-  commands.push_back(new cmConfigureFileCommand);
-  commands.push_back(new cmContinueCommand);
-  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 cmIfCommand);
-  commands.push_back(new cmIncludeCommand);
-  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 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 cmSiteNameCommand);
-  commands.push_back(new cmStringCommand);
-  commands.push_back(new cmUnsetCommand);
-  commands.push_back(new cmWhileCommand);
-
-  commands.push_back(new cmUnexpectedCommand(
+  state->AddCommand(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."));
-  commands.push_back(new cmUnexpectedCommand(
+  state->AddCommand(new cmUnexpectedCommand(
     "elseif", "An ELSEIF command was found outside of a proper "
               "IF ENDIF structure."));
-  commands.push_back(new cmUnexpectedCommand(
+  state->AddCommand(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."));
-  commands.push_back(new cmUnexpectedCommand(
+  state->AddCommand(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."));
-  commands.push_back(new cmUnexpectedCommand(
+  state->AddCommand(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."));
-  commands.push_back(new cmUnexpectedCommand(
+  state->AddCommand(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."));
-  commands.push_back(new cmUnexpectedCommand(
+  state->AddCommand(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)
-  commands.push_back(new cmCMakeHostSystemInformationCommand);
-  commands.push_back(new cmRemoveCommand);
-  commands.push_back(new cmVariableWatchCommand);
-  commands.push_back(new cmWriteFileCommand);
+  state->AddCommand(new cmCMakeHostSystemInformationCommand);
+  state->AddCommand(new cmRemoveCommand);
+  state->AddCommand(new cmVariableWatchCommand);
+  state->AddCommand(new cmWriteFileCommand);
 
-  commands.push_back(new cmDisallowedCommand(
+  state->AddCommand(new cmDisallowedCommand(
     new cmBuildNameCommand, cmPolicies::CMP0036,
     "The build_name command should not be called; see CMP0036."));
-  commands.push_back(new cmDisallowedCommand(
+  state->AddCommand(new cmDisallowedCommand(
     new cmUseMangledMesaCommand, cmPolicies::CMP0030,
     "The use_mangled_mesa command should not be called; see CMP0030."));
 
 #endif
-
-  return commands;
 }
 
-std::vector<cmCommand*> GetProjectCommands()
+void GetProjectCommands(cmState* state)
 {
-  std::vector<cmCommand*> commands;
-
-  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 cmBuildCommand);
-  commands.push_back(new cmCreateTestSourceList);
-  commands.push_back(new cmDefinePropertyCommand);
-  commands.push_back(new cmEnableLanguageCommand);
-  commands.push_back(new cmEnableTestingCommand);
-  commands.push_back(new cmGetSourceFilePropertyCommand);
-  commands.push_back(new cmGetTargetPropertyCommand);
-  commands.push_back(new cmGetTestPropertyCommand);
-  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 cmProjectCommand);
-  commands.push_back(new cmSetSourceFilesPropertiesCommand);
-  commands.push_back(new cmSetTargetPropertiesCommand);
-  commands.push_back(new cmSetTestsPropertiesCommand);
-  commands.push_back(new cmSubdirCommand);
-  commands.push_back(new cmTargetLinkLibrariesCommand);
-  commands.push_back(new cmTryCompileCommand);
-  commands.push_back(new cmTryRunCommand);
+  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)
-  commands.push_back(new cmAddCompileOptionsCommand);
-  commands.push_back(new cmAuxSourceDirectoryCommand);
-  commands.push_back(new cmExportCommand);
-  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 cmQTWrapCPPCommand);
-  commands.push_back(new cmQTWrapUICommand);
-  commands.push_back(new cmRemoveDefinitionsCommand);
-  commands.push_back(new cmSourceGroupCommand);
-  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);
+  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);
 
-  commands.push_back(new cmDisallowedCommand(
+  state->AddCommand(new cmDisallowedCommand(
     new cmExportLibraryDependenciesCommand, cmPolicies::CMP0033,
     "The export_library_dependencies command should not be called; "
     "see CMP0033."));
-  commands.push_back(new cmDisallowedCommand(
+  state->AddCommand(new cmDisallowedCommand(
     new cmLoadCommandCommand, cmPolicies::CMP0031,
     "The load_command command should not be called; see CMP0031."));
-  commands.push_back(new cmDisallowedCommand(
+  state->AddCommand(new cmDisallowedCommand(
     new cmOutputRequiredFilesCommand, cmPolicies::CMP0032,
     "The output_required_files command should not be called; "
     "see CMP0032."));
-  commands.push_back(new cmDisallowedCommand(
+  state->AddCommand(new cmDisallowedCommand(
     new cmSubdirDependsCommand, cmPolicies::CMP0029,
     "The subdir_depends command should not be called; see CMP0029."));
-  commands.push_back(new cmDisallowedCommand(
+  state->AddCommand(new cmDisallowedCommand(
     new cmUtilitySourceCommand, cmPolicies::CMP0034,
     "The utility_source command should not be called; see CMP0034."));
-  commands.push_back(new cmDisallowedCommand(
+  state->AddCommand(new cmDisallowedCommand(
     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 4d09e42..7895ece 100644
--- a/Source/cmCommands.h
+++ b/Source/cmCommands.h
@@ -3,17 +3,14 @@
 #ifndef cmCommands_h
 #define cmCommands_h
 
-#include <cmConfigure.h> // IWYU pragma: keep
+class cmState;
 
-#include <vector>
-
-class cmCommand;
 /**
- * Global function to return all compiled in commands.
+ * Global function to register 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.
  */
-std::vector<cmCommand*> GetScriptingCommands();
-std::vector<cmCommand*> GetProjectCommands();
+void GetScriptingCommands(cmState* state);
+void GetProjectCommands(cmState* state);
 
 #endif
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index c6292ce..b2384cd 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -120,8 +120,6 @@
 #include <string.h>
 #include <utility>
 
-class cmCommand;
-
 namespace {
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -1657,20 +1655,12 @@ const char* cmake::GetCacheDefinition(const 
std::string& name) const
 
 void cmake::AddScriptingCommands()
 {
-  std::vector<cmCommand*> const commands = GetScriptingCommands();
-  for (std::vector<cmCommand*>::const_iterator i = commands.begin();
-       i != commands.end(); ++i) {
-    this->State->AddCommand(*i);
-  }
+  GetScriptingCommands(this->State);
 }
 
 void cmake::AddProjectCommands()
 {
-  std::vector<cmCommand*> const commands = GetProjectCommands();
-  for (std::vector<cmCommand*>::const_iterator i = commands.begin();
-       i != commands.end(); ++i) {
-    this->State->AddCommand(*i);
-  }
+  GetProjectCommands(this->State);
 }
 
 void cmake::AddDefaultGenerators()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=72dcbbe5c017a4c071187259f9594ccf02f7b466
commit 72dcbbe5c017a4c071187259f9594ccf02f7b466
Author:     Daniel Pfeifer <dan...@pfeifer-mail.de>
AuthorDate: Fri Jan 20 22:12:32 2017 +0100
Commit:     Daniel Pfeifer <dan...@pfeifer-mail.de>
CommitDate: Mon Feb 13 22:32:55 2017 +0100

    split Default commands into Scripting and Project

diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst
index d0c2986..611c989 100644
--- a/Help/manual/cmake-commands.7.rst
+++ b/Help/manual/cmake-commands.7.rst
@@ -7,91 +7,103 @@ cmake-commands(7)
 
    .. contents::
 
-Normal Commands
-===============
+Scripting Commands
+==================
 
-These commands may be used freely in CMake projects.
+These commands are always available.
 
 .. 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
@@ -100,9 +112,30 @@ These commands may be used freely in CMake projects.
    /command/target_sources
    /command/try_compile
    /command/try_run
-   /command/unset
-   /command/variable_watch
-   /command/while
+
+.. _`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
 
 Deprecated Commands
 ===================
@@ -129,27 +162,3 @@ 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/cmCommands.cxx b/Source/cmCommands.cxx
index a6754eb..64cd12e 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -105,28 +105,15 @@
 #include "cmWriteFileCommand.h"
 #endif
 
-std::vector<cmCommand*> GetPredefinedCommands()
+std::vector<cmCommand*> GetScriptingCommands()
 {
   std::vector<cmCommand*> commands;
 
-  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);
@@ -141,17 +128,8 @@ std::vector<cmCommand*> GetPredefinedCommands()
   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);
@@ -160,21 +138,13 @@ std::vector<cmCommand*> GetPredefinedCommands()
   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);
 
@@ -207,9 +177,61 @@ std::vector<cmCommand*> GetPredefinedCommands()
                 "match the opening WHILE command."));
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
+  commands.push_back(new cmCMakeHostSystemInformationCommand);
+  commands.push_back(new cmRemoveCommand);
+  commands.push_back(new cmVariableWatchCommand);
+  commands.push_back(new cmWriteFileCommand);
+
+  commands.push_back(new cmDisallowedCommand(
+    new cmBuildNameCommand, cmPolicies::CMP0036,
+    "The build_name command should not be called; see CMP0036."));
+  commands.push_back(new cmDisallowedCommand(
+    new cmUseMangledMesaCommand, cmPolicies::CMP0030,
+    "The use_mangled_mesa command should not be called; see CMP0030."));
+
+#endif
+
+  return commands;
+}
+
+std::vector<cmCommand*> GetProjectCommands()
+{
+  std::vector<cmCommand*> commands;
+
+  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 cmBuildCommand);
+  commands.push_back(new cmCreateTestSourceList);
+  commands.push_back(new cmDefinePropertyCommand);
+  commands.push_back(new cmEnableLanguageCommand);
+  commands.push_back(new cmEnableTestingCommand);
+  commands.push_back(new cmGetSourceFilePropertyCommand);
+  commands.push_back(new cmGetTargetPropertyCommand);
+  commands.push_back(new cmGetTestPropertyCommand);
+  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 cmProjectCommand);
+  commands.push_back(new cmSetSourceFilesPropertiesCommand);
+  commands.push_back(new cmSetTargetPropertiesCommand);
+  commands.push_back(new cmSetTestsPropertiesCommand);
+  commands.push_back(new cmSubdirCommand);
+  commands.push_back(new cmTargetLinkLibrariesCommand);
+  commands.push_back(new cmTryCompileCommand);
+  commands.push_back(new cmTryRunCommand);
+
+#if defined(CMAKE_BUILD_WITH_CMAKE)
   commands.push_back(new cmAddCompileOptionsCommand);
   commands.push_back(new cmAuxSourceDirectoryCommand);
-  commands.push_back(new cmCMakeHostSystemInformationCommand);
   commands.push_back(new cmExportCommand);
   commands.push_back(new cmFLTKWrapUICommand);
   commands.push_back(new cmIncludeExternalMSProjectCommand);
@@ -218,7 +240,6 @@ std::vector<cmCommand*> GetPredefinedCommands()
   commands.push_back(new cmLoadCacheCommand);
   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 cmTargetCompileDefinitionsCommand);
@@ -226,13 +247,8 @@ std::vector<cmCommand*> GetPredefinedCommands()
   commands.push_back(new cmTargetCompileOptionsCommand);
   commands.push_back(new cmTargetIncludeDirectoriesCommand);
   commands.push_back(new cmTargetSourcesCommand);
-  commands.push_back(new cmVariableWatchCommand);
-  commands.push_back(new cmWriteFileCommand);
 
   commands.push_back(new cmDisallowedCommand(
-    new cmBuildNameCommand, cmPolicies::CMP0036,
-    "The build_name command should not be called; see CMP0036."));
-  commands.push_back(new cmDisallowedCommand(
     new cmExportLibraryDependenciesCommand, cmPolicies::CMP0033,
     "The export_library_dependencies command should not be called; "
     "see CMP0033."));
@@ -247,9 +263,6 @@ std::vector<cmCommand*> GetPredefinedCommands()
     new cmSubdirDependsCommand, cmPolicies::CMP0029,
     "The subdir_depends command should not be called; see CMP0029."));
   commands.push_back(new cmDisallowedCommand(
-    new cmUseMangledMesaCommand, cmPolicies::CMP0030,
-    "The use_mangled_mesa command should not be called; see CMP0030."));
-  commands.push_back(new cmDisallowedCommand(
     new cmUtilitySourceCommand, cmPolicies::CMP0034,
     "The utility_source command should not be called; see CMP0034."));
   commands.push_back(new cmDisallowedCommand(
diff --git a/Source/cmCommands.h b/Source/cmCommands.h
index 649dea6..4d09e42 100644
--- a/Source/cmCommands.h
+++ b/Source/cmCommands.h
@@ -13,6 +13,7 @@ class cmCommand;
  * 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.
  */
-std::vector<cmCommand*> GetPredefinedCommands();
+std::vector<cmCommand*> GetScriptingCommands();
+std::vector<cmCommand*> GetProjectCommands();
 
 #endif
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 6141f50..c6292ce 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -179,7 +179,8 @@ cmake::cmake()
 
   this->AddDefaultGenerators();
   this->AddDefaultExtraGenerators();
-  this->AddDefaultCommands();
+  this->AddScriptingCommands();
+  this->AddProjectCommands();
 
   // Make sure we can capture the build tool output.
   cmSystemTools::EnableVSConsoleOutput();
@@ -1654,9 +1655,18 @@ const char* cmake::GetCacheDefinition(const std::string& 
name) const
   return this->State->GetInitializedCacheValue(name);
 }
 
-void cmake::AddDefaultCommands()
+void cmake::AddScriptingCommands()
 {
-  std::vector<cmCommand*> const commands = GetPredefinedCommands();
+  std::vector<cmCommand*> const commands = GetScriptingCommands();
+  for (std::vector<cmCommand*>::const_iterator i = commands.begin();
+       i != commands.end(); ++i) {
+    this->State->AddCommand(*i);
+  }
+}
+
+void cmake::AddProjectCommands()
+{
+  std::vector<cmCommand*> const commands = GetProjectCommands();
   for (std::vector<cmCommand*>::const_iterator i = commands.begin();
        i != commands.end(); ++i) {
     this->State->AddCommand(*i);
diff --git a/Source/cmake.h b/Source/cmake.h
index 5347745..abb13ac 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -425,7 +425,8 @@ protected:
   typedef std::vector<cmExternalMakefileProjectGeneratorFactory*>
     RegisteredExtraGeneratorsVector;
   RegisteredExtraGeneratorsVector ExtraGenerators;
-  void AddDefaultCommands();
+  void AddScriptingCommands();
+  void AddProjectCommands();
   void AddDefaultGenerators();
   void AddDefaultExtraGenerators();
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7fb14775a3cce73dc0cb0d759b96059a95f7104b
commit 7fb14775a3cce73dc0cb0d759b96059a95f7104b
Author:     Daniel Pfeifer <dan...@pfeifer-mail.de>
AuthorDate: Mon Dec 26 00:34:44 2016 +0100
Commit:     Daniel Pfeifer <dan...@pfeifer-mail.de>
CommitDate: Mon Feb 13 21:37:08 2017 +0100

    cmDisallowedCommand: extract policy checking from cmCommand
    
    Implement cmDisallowedCommand as a wrapper class for cmCommand.

diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 2835ee6..3b49f72 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -440,6 +440,8 @@ set(SRCS
   cmCreateTestSourceList.h
   cmDefinePropertyCommand.cxx
   cmDefinePropertyCommand.h
+  cmDisallowedCommand.cxx
+  cmDisallowedCommand.h
   cmEnableLanguageCommand.cxx
   cmEnableLanguageCommand.h
   cmEnableTestingCommand.cxx
diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx
index 1e1cd21..12b69a8 100644
--- a/Source/cmBuildNameCommand.cxx
+++ b/Source/cmBuildNameCommand.cxx
@@ -16,11 +16,6 @@ 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 15bed27..d349c91 100644
--- a/Source/cmCommand.cxx
+++ b/Source/cmCommand.cxx
@@ -3,7 +3,6 @@
 #include "cmCommand.h"
 
 #include "cmMakefile.h"
-#include "cmake.h"
 
 class cmExecutionStatus;
 struct cmListFileArgument;
@@ -32,20 +31,3 @@ void cmCommand::SetError(const std::string& e)
 {
   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 32f4472..9107d85 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -7,8 +7,6 @@
 #include <string>
 #include <vector>
 
-#include "cmPolicies.h"
-
 class cmExecutionStatus;
 class cmMakefile;
 struct cmListFileArgument;
@@ -104,9 +102,6 @@ public:
    */
   void SetError(const std::string& e);
 
-  /** Check if the command is disallowed by a policy.  */
-  bool Disallowed(cmPolicies::PolicyID pol, const char* e);
-
 private:
   cmCommand(cmCommand const&);            // = delete;
   cmCommand& operator=(cmCommand const&); // = delete;
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index 4c5b093..a6754eb 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -77,6 +77,7 @@
 #include "cmAuxSourceDirectoryCommand.h"
 #include "cmBuildNameCommand.h"
 #include "cmCMakeHostSystemInformationCommand.h"
+#include "cmDisallowedCommand.h"
 #include "cmExportCommand.h"
 #include "cmExportLibraryDependenciesCommand.h"
 #include "cmFLTKWrapUICommand.h"
@@ -208,33 +209,52 @@ std::vector<cmCommand*> GetPredefinedCommands()
 #if defined(CMAKE_BUILD_WITH_CMAKE)
   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);
+
+  commands.push_back(new cmDisallowedCommand(
+    new cmBuildNameCommand, cmPolicies::CMP0036,
+    "The build_name command should not be called; see CMP0036."));
+  commands.push_back(new cmDisallowedCommand(
+    new cmExportLibraryDependenciesCommand, cmPolicies::CMP0033,
+    "The export_library_dependencies command should not be called; "
+    "see CMP0033."));
+  commands.push_back(new cmDisallowedCommand(
+    new cmLoadCommandCommand, cmPolicies::CMP0031,
+    "The load_command command should not be called; see CMP0031."));
+  commands.push_back(new cmDisallowedCommand(
+    new cmOutputRequiredFilesCommand, cmPolicies::CMP0032,
+    "The output_required_files command should not be called; "
+    "see CMP0032."));
+  commands.push_back(new cmDisallowedCommand(
+    new cmSubdirDependsCommand, cmPolicies::CMP0029,
+    "The subdir_depends command should not be called; see CMP0029."));
+  commands.push_back(new cmDisallowedCommand(
+    new cmUseMangledMesaCommand, cmPolicies::CMP0030,
+    "The use_mangled_mesa command should not be called; see CMP0030."));
+  commands.push_back(new cmDisallowedCommand(
+    new cmUtilitySourceCommand, cmPolicies::CMP0034,
+    "The utility_source command should not be called; see CMP0034."));
+  commands.push_back(new cmDisallowedCommand(
+    new cmVariableRequiresCommand, cmPolicies::CMP0035,
+    "The variable_requires command should not be called; see CMP0035."));
 #endif
 
   return commands;
diff --git a/Source/cmDisallowedCommand.cxx b/Source/cmDisallowedCommand.cxx
new file mode 100644
index 0000000..ce1965d
--- /dev/null
+++ b/Source/cmDisallowedCommand.cxx
@@ -0,0 +1,31 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#include "cmDisallowedCommand.h"
+
+#include "cmMakefile.h"
+#include "cmake.h"
+
+class cmExecutionStatus;
+
+bool cmDisallowedCommand::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/cmDisallowedCommand.h b/Source/cmDisallowedCommand.h
new file mode 100644
index 0000000..9cf5e6f
--- /dev/null
+++ b/Source/cmDisallowedCommand.h
@@ -0,0 +1,50 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#ifndef cmDisallowedCommand_h
+#define cmDisallowedCommand_h
+
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
+#include "cmCommand.h"
+#include "cmPolicies.h"
+
+class cmExecutionStatus;
+
+class cmDisallowedCommand : public cmCommand
+{
+public:
+  cmDisallowedCommand(cmCommand* command, cmPolicies::PolicyID policy,
+                      const char* message)
+    : Command(command)
+    , Policy(policy)
+    , Message(message)
+  {
+  }
+
+  ~cmDisallowedCommand() CM_OVERRIDE { delete this->Command; }
+
+  cmCommand* Clone() CM_OVERRIDE
+  {
+    return new cmDisallowedCommand(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/cmExportLibraryDependenciesCommand.cxx 
b/Source/cmExportLibraryDependenciesCommand.cxx
index ac4f040..e3fb412 100644
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
@@ -23,12 +23,6 @@ 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 b6743f1..39e5684 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -174,11 +174,6 @@ 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/cmOutputRequiredFilesCommand.cxx 
b/Source/cmOutputRequiredFilesCommand.cxx
index 7a17f2c..f120971 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -495,11 +495,6 @@ 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 9259836..36e84d5 100644
--- a/Source/cmSubdirDependsCommand.cxx
+++ b/Source/cmSubdirDependsCommand.cxx
@@ -9,8 +9,5 @@ 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 3e72d75..3d57f0e 100644
--- a/Source/cmUseMangledMesaCommand.cxx
+++ b/Source/cmUseMangledMesaCommand.cxx
@@ -13,11 +13,6 @@ 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 3b78abe..9b24a74 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -16,11 +16,6 @@ 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 1eb1f20..bff6ec5 100644
--- a/Source/cmVariableRequiresCommand.cxx
+++ b/Source/cmVariableRequiresCommand.cxx
@@ -13,11 +13,6 @@ 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;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=615e2a17e499b2bd53cce8da1a0cfae36d67b24a
commit 615e2a17e499b2bd53cce8da1a0cfae36d67b24a
Author:     Daniel Pfeifer <dan...@pfeifer-mail.de>
AuthorDate: Sat Jan 7 13:48:44 2017 +0100
Commit:     Daniel Pfeifer <dan...@pfeifer-mail.de>
CommitDate: Mon Feb 13 20:49:20 2017 +0100

    cmCommand: Don't prefix error message with command name
    
    Instead, prefix the error message at the two places where the errors are
    handled: cmMakefile and cmCTestHandlerCommand.

diff --git a/Source/CTest/cmCTestHandlerCommand.cxx 
b/Source/CTest/cmCTestHandlerCommand.cxx
index a989b12..2a67d47 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");
-      const char* err = this->GetError();
-      if (err && !cmSystemTools::FindLastString(err, "unknown error.")) {
+      std::string const err = this->GetName() + " " + this->GetError();
+      if (!cmSystemTools::FindLastString(err.c_str(), "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/cmCommand.cxx b/Source/cmCommand.cxx
index 181b412..15bed27 100644
--- a/Source/cmCommand.cxx
+++ b/Source/cmCommand.cxx
@@ -23,17 +23,14 @@ bool cmCommand::InvokeInitialPass(const 
std::vector<cmListFileArgument>& args,
 const char* cmCommand::GetError()
 {
   if (this->Error.empty()) {
-    this->Error = this->GetName();
-    this->Error += " unknown error.";
+    return "unknown error.";
   }
   return this->Error.c_str();
 }
 
 void cmCommand::SetError(const std::string& e)
 {
-  this->Error = this->GetName();
-  this->Error += " ";
-  this->Error += e;
+  this->Error = e;
 }
 
 bool cmCommand::Disallowed(cmPolicies::PolicyID pol, const char* e)
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 618f694..bdaca97 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -281,7 +281,8 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& 
lff,
       if (!invokeSucceeded || hadNestedError) {
         if (!hadNestedError) {
           // The command invocation requested that we report an error.
-          this->IssueMessage(cmake::FATAL_ERROR, pcmd->GetError());
+          std::string const error = name + " " + pcmd->GetError();
+          this->IssueMessage(cmake::FATAL_ERROR, error);
         }
         result = false;
         if (this->GetCMakeInstance()->GetWorkingMode() != cmake::NORMAL_MODE) {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=45b49099d9dd034fd1e7344b3bae88b0e3d3427a
commit 45b49099d9dd034fd1e7344b3bae88b0e3d3427a
Author:     Daniel Pfeifer <dan...@pfeifer-mail.de>
AuthorDate: Sun Dec 25 23:50:18 2016 +0100
Commit:     Daniel Pfeifer <dan...@pfeifer-mail.de>
CommitDate: Mon Feb 13 20:48:29 2017 +0100

    cmCommand: make noncopyable

diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index ff30638..32f4472 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -107,6 +107,10 @@ public:
   /** Check if the command is disallowed by a policy.  */
   bool Disallowed(cmPolicies::PolicyID pol, const char* e);
 
+private:
+  cmCommand(cmCommand const&);            // = delete;
+  cmCommand& operator=(cmCommand const&); // = delete;
+
 protected:
   cmMakefile* Makefile;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5396bc92d0162fa9a9462e15ccaae8764da8ff98
commit 5396bc92d0162fa9a9462e15ccaae8764da8ff98
Author:     Daniel Pfeifer <dan...@pfeifer-mail.de>
AuthorDate: Sun Dec 25 23:27:48 2016 +0100
Commit:     Daniel Pfeifer <dan...@pfeifer-mail.de>
CommitDate: Mon Feb 13 20:48:29 2017 +0100

    cmCommand: remove member Helper
    
    The Helper member is used in a single derived class only.
    Remove it from the base class to the only place where it is used.

diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index d9fd5a2..ff30638 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -7,7 +7,6 @@
 #include <string>
 #include <vector>
 
-#include "cmCommandArgumentsHelper.h"
 #include "cmPolicies.h"
 
 class cmExecutionStatus;
@@ -110,7 +109,6 @@ public:
 
 protected:
   cmMakefile* Makefile;
-  cmCommandArgumentsHelper Helper;
 
 private:
   std::string Error;
diff --git a/Source/cmExportCommand.h b/Source/cmExportCommand.h
index 99dac7d..a0224d0 100644
--- a/Source/cmExportCommand.h
+++ b/Source/cmExportCommand.h
@@ -41,6 +41,7 @@ public:
   std::string GetName() const CM_OVERRIDE { return "export"; }
 
 private:
+  cmCommandArgumentsHelper Helper;
   cmCommandArgumentGroup ArgumentGroup;
   cmCAStringVector Targets;
   cmCAEnabler Append;

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

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/cmDisallowedCommand.cxx                |   31 ++++
 Source/cmDisallowedCommand.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, 313 insertions(+), 257 deletions(-)
 create mode 100644 Source/cmDisallowedCommand.cxx
 create mode 100644 Source/cmDisallowedCommand.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