Browse Source

Merge topic 'separate-compilation'

569509f4 Fix newly discovered clang-tidy issues
6c9b3b5c cmCommand: implement functions in cxx file
8483dab8 bootstrap: Sort source files lexicographically
4fb70919 Create all commands from a single function
608afd4f Separate compilation for commands included in cmBootstrapCommands2
64f9c282 Separate compilation for commands included in cmBootstrapCommands1
f69e768d Separate compilation for commands included in cmCommands
Brad King 9 years ago
parent
commit
b899c0a92f
100 changed files with 976 additions and 342 deletions
  1. 237 50
      Source/CMakeLists.txt
  2. 4 0
      Source/cmAddCompileOptionsCommand.cxx
  3. 7 0
      Source/cmAddCompileOptionsCommand.h
  4. 2 0
      Source/cmAddExecutableCommand.cxx
  5. 4 2
      Source/cmAddLibraryCommand.cxx
  6. 2 0
      Source/cmAddSubDirectoryCommand.cxx
  7. 9 1
      Source/cmAuxSourceDirectoryCommand.cxx
  8. 7 0
      Source/cmAuxSourceDirectoryCommand.h
  9. 0 87
      Source/cmBootstrapCommands1.cxx
  10. 0 94
      Source/cmBootstrapCommands2.cxx
  11. 8 0
      Source/cmBuildNameCommand.cxx
  12. 7 0
      Source/cmBuildNameCommand.h
  13. 7 0
      Source/cmCMakeHostSystemInformationCommand.cxx
  14. 10 1
      Source/cmCMakeHostSystemInformationCommand.h
  15. 1 0
      Source/cmCMakeMinimumRequired.cxx
  16. 4 2
      Source/cmCPluginAPI.cxx
  17. 48 0
      Source/cmCommand.cxx
  18. 6 42
      Source/cmCommand.h
  19. 238 0
      Source/cmCommands.cxx
  20. 0 10
      Source/cmCommands.cxx.in
  21. 3 7
      Source/cmCommands.h
  22. 0 7
      Source/cmCommandsForBootstrap.cxx
  23. 6 6
      Source/cmConditionEvaluator.cxx
  24. 2 0
      Source/cmConfigureFileCommand.cxx
  25. 3 0
      Source/cmContinueCommand.cxx
  26. 1 0
      Source/cmCreateTestSourceList.cxx
  27. 2 0
      Source/cmElseIfCommand.cxx
  28. 8 1
      Source/cmElseIfCommand.h
  29. 13 5
      Source/cmExportCommand.cxx
  30. 7 1
      Source/cmExportCommand.h
  31. 10 2
      Source/cmExportLibraryDependenciesCommand.cxx
  32. 7 0
      Source/cmExportLibraryDependenciesCommand.h
  33. 8 0
      Source/cmFLTKWrapUICommand.cxx
  34. 8 0
      Source/cmFLTKWrapUICommand.h
  35. 2 6
      Source/cmFileCommand.cxx
  36. 2 1
      Source/cmFindBase.cxx
  37. 2 0
      Source/cmFindCommon.cxx
  38. 4 0
      Source/cmFindLibraryCommand.cxx
  39. 10 9
      Source/cmFindPackageCommand.cxx
  40. 2 0
      Source/cmFindPathCommand.cxx
  41. 2 0
      Source/cmFindProgramCommand.cxx
  42. 2 0
      Source/cmForEachCommand.cxx
  43. 2 0
      Source/cmFunctionCommand.cxx
  44. 1 0
      Source/cmGetCMakePropertyCommand.cxx
  45. 2 0
      Source/cmGetDirectoryPropertyCommand.cxx
  46. 3 1
      Source/cmHexFileConverter.cxx
  47. 1 0
      Source/cmIfCommand.cxx
  48. 3 0
      Source/cmIncludeCommand.cxx
  49. 2 0
      Source/cmIncludeDirectoryCommand.cxx
  50. 6 0
      Source/cmIncludeExternalMSProjectCommand.cxx
  51. 7 0
      Source/cmIncludeExternalMSProjectCommand.h
  52. 2 0
      Source/cmInstallCommand.cxx
  53. 2 0
      Source/cmInstallFilesCommand.cxx
  54. 8 0
      Source/cmInstallProgramsCommand.cxx
  55. 7 0
      Source/cmInstallProgramsCommand.h
  56. 2 0
      Source/cmInstallTargetsCommand.cxx
  57. 2 0
      Source/cmLinkDirectoriesCommand.cxx
  58. 4 0
      Source/cmLinkLibrariesCommand.cxx
  59. 7 0
      Source/cmLinkLibrariesCommand.h
  60. 1 0
      Source/cmListCommand.cxx
  61. 7 1
      Source/cmLoadCacheCommand.cxx
  62. 8 0
      Source/cmLoadCacheCommand.h
  63. 10 3
      Source/cmLoadCommandCommand.cxx
  64. 7 0
      Source/cmLoadCommandCommand.h
  65. 2 0
      Source/cmMacroCommand.cxx
  66. 2 0
      Source/cmMakeDirectoryCommand.cxx
  67. 3 0
      Source/cmMarkAsAdvancedCommand.cxx
  68. 1 0
      Source/cmMessageCommand.cxx
  69. 3 0
      Source/cmOptionCommand.cxx
  70. 11 1
      Source/cmOutputRequiredFilesCommand.cxx
  71. 8 0
      Source/cmOutputRequiredFilesCommand.h
  72. 1 0
      Source/cmParseArgumentsCommand.cxx
  73. 2 0
      Source/cmProjectCommand.cxx
  74. 7 0
      Source/cmQTWrapCPPCommand.cxx
  75. 6 1
      Source/cmQTWrapCPPCommand.h
  76. 7 0
      Source/cmQTWrapUICommand.cxx
  77. 6 1
      Source/cmQTWrapUICommand.h
  78. 5 0
      Source/cmRemoveCommand.cxx
  79. 7 0
      Source/cmRemoveCommand.h
  80. 4 0
      Source/cmRemoveDefinitionsCommand.cxx
  81. 7 0
      Source/cmRemoveDefinitionsCommand.h
  82. 2 0
      Source/cmReturnCommand.cxx
  83. 1 0
      Source/cmSearchPath.cxx
  84. 2 0
      Source/cmSeparateArgumentsCommand.cxx
  85. 3 0
      Source/cmSetCommand.cxx
  86. 4 0
      Source/cmSetPropertyCommand.cxx
  87. 1 0
      Source/cmSetSourceFilesPropertiesCommand.cxx
  88. 2 0
      Source/cmSiteNameCommand.cxx
  89. 8 0
      Source/cmSourceGroupCommand.cxx
  90. 7 0
      Source/cmSourceGroupCommand.h
  91. 1 0
      Source/cmStringCommand.cxx
  92. 2 0
      Source/cmSubdirCommand.cxx
  93. 4 0
      Source/cmSubdirDependsCommand.cxx
  94. 7 0
      Source/cmSubdirDependsCommand.h
  95. 7 0
      Source/cmTargetCompileDefinitionsCommand.cxx
  96. 9 0
      Source/cmTargetCompileDefinitionsCommand.h
  97. 8 0
      Source/cmTargetCompileFeaturesCommand.cxx
  98. 9 0
      Source/cmTargetCompileFeaturesCommand.h
  99. 9 0
      Source/cmTargetCompileOptionsCommand.cxx
  100. 9 0
      Source/cmTargetCompileOptionsCommand.h

+ 237 - 50
Source/CMakeLists.txt

@@ -159,14 +159,10 @@ endif()
 set(SRCS
   cmArchiveWrite.cxx
   cmBase32.cxx
-  cmBootstrapCommands1.cxx
-  cmBootstrapCommands2.cxx
   cmCacheManager.cxx
   cmCacheManager.h
-  "${CMAKE_CURRENT_BINARY_DIR}/cmCommands.cxx"
   cmCLocaleEnvironmentScope.h
   cmCLocaleEnvironmentScope.cxx
-  cmCommands.h
   cmCommandArgumentLexer.cxx
   cmCommandArgumentParser.cxx
   cmCommandArgumentParserHelper.cxx
@@ -390,6 +386,243 @@ set(SRCS
   cmake.cxx
   cmake.h
 
+  cmCommand.cxx
+  cmCommand.h
+  cmCommands.cxx
+  cmCommands.h
+  cmAddCompileOptionsCommand.cxx
+  cmAddCompileOptionsCommand.h
+  cmAddCustomCommandCommand.cxx
+  cmAddCustomCommandCommand.h
+  cmAddCustomTargetCommand.cxx
+  cmAddCustomTargetCommand.h
+  cmAddDefinitionsCommand.cxx
+  cmAddDefinitionsCommand.h
+  cmAddDependenciesCommand.cxx
+  cmAddDependenciesCommand.h
+  cmAddExecutableCommand.cxx
+  cmAddExecutableCommand.h
+  cmAddLibraryCommand.cxx
+  cmAddLibraryCommand.h
+  cmAddSubDirectoryCommand.cxx
+  cmAddSubDirectoryCommand.h
+  cmAddTestCommand.cxx
+  cmAddTestCommand.h
+  cmAuxSourceDirectoryCommand.cxx
+  cmAuxSourceDirectoryCommand.h
+  cmBreakCommand.cxx
+  cmBreakCommand.h
+  cmBuildCommand.cxx
+  cmBuildCommand.h
+  cmBuildNameCommand.cxx
+  cmBuildNameCommand.h
+  cmCMakeHostSystemInformationCommand.cxx
+  cmCMakeHostSystemInformationCommand.h
+  cmCMakeMinimumRequired.cxx
+  cmCMakeMinimumRequired.h
+  cmCMakePolicyCommand.cxx
+  cmCMakePolicyCommand.h
+  cmCommandArgumentsHelper.cxx
+  cmCommandArgumentsHelper.h
+  cmConditionEvaluator.cxx
+  cmConditionEvaluator.h
+  cmConfigureFileCommand.cxx
+  cmConfigureFileCommand.h
+  cmContinueCommand.cxx
+  cmContinueCommand.h
+  cmCoreTryCompile.cxx
+  cmCoreTryCompile.h
+  cmCreateTestSourceList.cxx
+  cmCreateTestSourceList.h
+  cmDefinePropertyCommand.cxx
+  cmDefinePropertyCommand.h
+  cmElseCommand.cxx
+  cmElseCommand.h
+  cmElseIfCommand.cxx
+  cmElseIfCommand.h
+  cmEnableLanguageCommand.cxx
+  cmEnableLanguageCommand.h
+  cmEnableTestingCommand.cxx
+  cmEnableTestingCommand.h
+  cmEndForEachCommand.cxx
+  cmEndForEachCommand.h
+  cmEndFunctionCommand.cxx
+  cmEndFunctionCommand.h
+  cmEndIfCommand.cxx
+  cmEndIfCommand.h
+  cmEndMacroCommand.cxx
+  cmEndMacroCommand.h
+  cmEndWhileCommand.cxx
+  cmEndWhileCommand.h
+  cmExecProgramCommand.cxx
+  cmExecProgramCommand.h
+  cmExecuteProcessCommand.cxx
+  cmExecuteProcessCommand.h
+  cmExpandedCommandArgument.cxx
+  cmExpandedCommandArgument.h
+  cmExportCommand.cxx
+  cmExportCommand.h
+  cmExportLibraryDependenciesCommand.cxx
+  cmExportLibraryDependenciesCommand.h
+  cmFLTKWrapUICommand.cxx
+  cmFLTKWrapUICommand.h
+  cmFileCommand.cxx
+  cmFileCommand.h
+  cmFindBase.cxx
+  cmFindBase.h
+  cmFindCommon.cxx
+  cmFindCommon.h
+  cmFindFileCommand.cxx
+  cmFindFileCommand.h
+  cmFindLibraryCommand.cxx
+  cmFindLibraryCommand.h
+  cmFindPackageCommand.cxx
+  cmFindPackageCommand.h
+  cmFindPathCommand.cxx
+  cmFindPathCommand.h
+  cmFindProgramCommand.cxx
+  cmFindProgramCommand.h
+  cmForEachCommand.cxx
+  cmForEachCommand.h
+  cmFunctionCommand.cxx
+  cmFunctionCommand.h
+  cmGetCMakePropertyCommand.cxx
+  cmGetCMakePropertyCommand.h
+  cmGetDirectoryPropertyCommand.cxx
+  cmGetDirectoryPropertyCommand.h
+  cmGetFilenameComponentCommand.cxx
+  cmGetFilenameComponentCommand.h
+  cmGetPropertyCommand.cxx
+  cmGetPropertyCommand.h
+  cmGetSourceFilePropertyCommand.cxx
+  cmGetSourceFilePropertyCommand.h
+  cmGetTargetPropertyCommand.cxx
+  cmGetTargetPropertyCommand.h
+  cmGetTestPropertyCommand.cxx
+  cmGetTestPropertyCommand.h
+  cmHexFileConverter.cxx
+  cmHexFileConverter.h
+  cmIfCommand.cxx
+  cmIfCommand.h
+  cmIncludeCommand.cxx
+  cmIncludeCommand.h
+  cmIncludeDirectoryCommand.cxx
+  cmIncludeDirectoryCommand.h
+  cmIncludeExternalMSProjectCommand.cxx
+  cmIncludeExternalMSProjectCommand.h
+  cmIncludeRegularExpressionCommand.cxx
+  cmIncludeRegularExpressionCommand.h
+  cmInstallCommand.cxx
+  cmInstallCommand.h
+  cmInstallCommandArguments.cxx
+  cmInstallCommandArguments.h
+  cmInstallFilesCommand.cxx
+  cmInstallFilesCommand.h
+  cmInstallProgramsCommand.cxx
+  cmInstallProgramsCommand.h
+  cmInstallTargetsCommand.cxx
+  cmInstallTargetsCommand.h
+  cmLinkDirectoriesCommand.cxx
+  cmLinkDirectoriesCommand.h
+  cmLinkLibrariesCommand.cxx
+  cmLinkLibrariesCommand.h
+  cmListCommand.cxx
+  cmListCommand.h
+  cmLoadCacheCommand.cxx
+  cmLoadCacheCommand.h
+  cmLoadCommandCommand.cxx
+  cmLoadCommandCommand.h
+  cmMacroCommand.cxx
+  cmMacroCommand.h
+  cmMakeDirectoryCommand.cxx
+  cmMakeDirectoryCommand.h
+  cmMarkAsAdvancedCommand.cxx
+  cmMarkAsAdvancedCommand.h
+  cmMathCommand.cxx
+  cmMathCommand.h
+  cmMessageCommand.cxx
+  cmMessageCommand.h
+  cmOptionCommand.cxx
+  cmOptionCommand.h
+  cmOutputRequiredFilesCommand.cxx
+  cmOutputRequiredFilesCommand.h
+  cmParseArgumentsCommand.cxx
+  cmParseArgumentsCommand.h
+  cmPathLabel.cxx
+  cmPathLabel.h
+  cmProjectCommand.cxx
+  cmProjectCommand.h
+  cmQTWrapCPPCommand.cxx
+  cmQTWrapCPPCommand.h
+  cmQTWrapUICommand.cxx
+  cmQTWrapUICommand.h
+  cmRemoveCommand.cxx
+  cmRemoveCommand.h
+  cmRemoveDefinitionsCommand.cxx
+  cmRemoveDefinitionsCommand.h
+  cmReturnCommand.cxx
+  cmReturnCommand.h
+  cmSearchPath.cxx
+  cmSearchPath.h
+  cmSeparateArgumentsCommand.cxx
+  cmSeparateArgumentsCommand.h
+  cmSetCommand.cxx
+  cmSetCommand.h
+  cmSetDirectoryPropertiesCommand.cxx
+  cmSetDirectoryPropertiesCommand.h
+  cmSetPropertyCommand.cxx
+  cmSetPropertyCommand.h
+  cmSetSourceFilesPropertiesCommand.cxx
+  cmSetSourceFilesPropertiesCommand.h
+  cmSetTargetPropertiesCommand.cxx
+  cmSetTargetPropertiesCommand.h
+  cmSetTestsPropertiesCommand.cxx
+  cmSetTestsPropertiesCommand.h
+  cmSiteNameCommand.cxx
+  cmSiteNameCommand.h
+  cmSourceGroupCommand.cxx
+  cmSourceGroupCommand.h
+  cmStringCommand.cxx
+  cmStringCommand.h
+  cmSubdirCommand.cxx
+  cmSubdirCommand.h
+  cmSubdirDependsCommand.cxx
+  cmSubdirDependsCommand.h
+  cmTargetCompileDefinitionsCommand.cxx
+  cmTargetCompileDefinitionsCommand.h
+  cmTargetCompileFeaturesCommand.cxx
+  cmTargetCompileFeaturesCommand.h
+  cmTargetCompileOptionsCommand.cxx
+  cmTargetCompileOptionsCommand.h
+  cmTargetIncludeDirectoriesCommand.cxx
+  cmTargetIncludeDirectoriesCommand.h
+  cmTargetLinkLibrariesCommand.cxx
+  cmTargetLinkLibrariesCommand.h
+  cmTargetPropCommandBase.cxx
+  cmTargetPropCommandBase.h
+  cmTargetSourcesCommand.cxx
+  cmTargetSourcesCommand.h
+  cmTimestamp.cxx
+  cmTimestamp.h
+  cmTryCompileCommand.cxx
+  cmTryCompileCommand.h
+  cmTryRunCommand.cxx
+  cmTryRunCommand.h
+  cmUnsetCommand.cxx
+  cmUnsetCommand.h
+  cmUseMangledMesaCommand.cxx
+  cmUseMangledMesaCommand.h
+  cmUtilitySourceCommand.cxx
+  cmUtilitySourceCommand.h
+  cmVariableRequiresCommand.cxx
+  cmVariableRequiresCommand.h
+  cmVariableWatchCommand.cxx
+  cmVariableWatchCommand.h
+  cmWhileCommand.cxx
+  cmWhileCommand.h
+  cmWriteFileCommand.cxx
+  cmWriteFileCommand.h
+
   cm_auto_ptr.hxx
   cm_get_date.h
   cm_get_date.c
@@ -401,52 +634,6 @@ set(SRCS
   cm_codecvt.cxx
   )
 
-set(COMMAND_INCLUDES "#include \"cmTargetPropCommandBase.cxx\"\n")
-list(APPEND SRCS cmTargetPropCommandBase.cxx)
-set_property(SOURCE cmTargetPropCommandBase.cxx PROPERTY HEADER_FILE_ONLY ON)
-set(NEW_COMMANDS "")
-foreach(command_file
-    cmAddCompileOptionsCommand
-    cmAuxSourceDirectoryCommand
-    cmBuildNameCommand
-    cmCMakeHostSystemInformationCommand
-    cmElseIfCommand
-    cmExportCommand
-    cmExportLibraryDependenciesCommand
-    cmFLTKWrapUICommand
-    cmIncludeExternalMSProjectCommand
-    cmInstallProgramsCommand
-    cmLinkLibrariesCommand
-    cmLoadCacheCommand
-    cmOutputRequiredFilesCommand
-    cmQTWrapCPPCommand
-    cmQTWrapUICommand
-    cmRemoveCommand
-    cmRemoveDefinitionsCommand
-    cmSourceGroupCommand
-    cmSubdirDependsCommand
-    cmTargetCompileDefinitionsCommand
-    cmTargetCompileFeaturesCommand
-    cmTargetCompileOptionsCommand
-    cmTargetIncludeDirectoriesCommand
-    cmTargetSourcesCommand
-    cmUseMangledMesaCommand
-    cmUtilitySourceCommand
-    cmVariableRequiresCommand
-    cmVariableWatchCommand
-    cmWriteFileCommand
-    # This one must be last because it includes windows.h and
-    # windows.h #defines GetCurrentDirectory which is a member
-    # of cmMakefile
-    cmLoadCommandCommand
-    )
-  set(COMMAND_INCLUDES "${COMMAND_INCLUDES}#include \"${command_file}.cxx\"\n")
-  set(NEW_COMMANDS "${NEW_COMMANDS}commands.push_back(new ${command_file});\n")
-  list(APPEND SRCS ${command_file}.cxx)
-  set_property(SOURCE ${command_file}.cxx PROPERTY HEADER_FILE_ONLY ON)
-endforeach()
-configure_file(cmCommands.cxx.in ${CMAKE_CURRENT_BINARY_DIR}/cmCommands.cxx @ONLY)
-
 # Kdevelop only works on UNIX and not windows
 if(UNIX)
   set(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx)

+ 4 - 0
Source/cmAddCompileOptionsCommand.cxx

@@ -2,6 +2,10 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmAddCompileOptionsCommand.h"
 
+#include "cmMakefile.h"
+
+class cmExecutionStatus;
+
 bool cmAddCompileOptionsCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {

+ 7 - 0
Source/cmAddCompileOptionsCommand.h

@@ -3,7 +3,14 @@
 #ifndef cmAddCompileOptionsCommand_h
 #define cmAddCompileOptionsCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 class cmAddCompileOptionsCommand : public cmCommand
 {

+ 2 - 0
Source/cmAddExecutableCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmAddExecutableCommand.h"
 
+#include "cmGlobalGenerator.h"
+
 // cmExecutableCommand
 bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args,
                                          cmExecutionStatus&)

+ 4 - 2
Source/cmAddLibraryCommand.cxx

@@ -2,8 +2,10 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmAddLibraryCommand.h"
 
+#include "cmGlobalGenerator.h"
 #include "cmState.h"
 #include "cmStateTypes.h"
+#include "cmSystemTools.h"
 #include "cmake.h"
 
 // cmLibraryCommand
@@ -268,8 +270,8 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
     yet its linker language. */
   if ((type == cmStateEnums::SHARED_LIBRARY ||
        type == cmStateEnums::MODULE_LIBRARY) &&
-      (this->Makefile->GetState()->GetGlobalPropertyAsBool(
-         "TARGET_SUPPORTS_SHARED_LIBS") == false)) {
+      !this->Makefile->GetState()->GetGlobalPropertyAsBool(
+        "TARGET_SUPPORTS_SHARED_LIBS")) {
     std::ostringstream w;
     w << "ADD_LIBRARY called with "
       << (type == cmStateEnums::SHARED_LIBRARY ? "SHARED" : "MODULE")

+ 2 - 0
Source/cmAddSubDirectoryCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmAddSubDirectoryCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmAddSubDirectoryCommand
 bool cmAddSubDirectoryCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 9 - 1
Source/cmAuxSourceDirectoryCommand.cxx

@@ -2,9 +2,17 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmAuxSourceDirectoryCommand.h"
 
+#include <algorithm>
+#include <cmsys/Directory.hxx>
+#include <stddef.h>
+
+#include "cmAlgorithms.h"
+#include "cmMakefile.h"
 #include "cmSourceFile.h"
+#include "cmSystemTools.h"
+#include "cmake.h"
 
-#include <cmsys/Directory.hxx>
+class cmExecutionStatus;
 
 // cmAuxSourceDirectoryCommand
 bool cmAuxSourceDirectoryCommand::InitialPass(

+ 7 - 0
Source/cmAuxSourceDirectoryCommand.h

@@ -3,7 +3,14 @@
 #ifndef cmAuxSourceDirectoryCommand_h
 #define cmAuxSourceDirectoryCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 /** \class cmAuxSourceDirectoryCommand
  * \brief Specify auxiliary source code directories.

+ 0 - 87
Source/cmBootstrapCommands1.cxx

@@ -1,87 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file Copyright.txt or https://cmake.org/licensing for details.  */
-// This file is used to compile all the commands
-// that CMake knows about at compile time.
-// This is sort of a boot strapping approach since you would
-// like to have CMake to build CMake.
-#include "cmAddCustomCommandCommand.cxx"
-#include "cmAddCustomTargetCommand.cxx"
-#include "cmAddDefinitionsCommand.cxx"
-#include "cmAddDependenciesCommand.cxx"
-#include "cmAddExecutableCommand.cxx"
-#include "cmAddLibraryCommand.cxx"
-#include "cmAddSubDirectoryCommand.cxx"
-#include "cmAddTestCommand.cxx"
-#include "cmBreakCommand.cxx"
-#include "cmBuildCommand.cxx"
-#include "cmCMakeMinimumRequired.cxx"
-#include "cmCMakePolicyCommand.cxx"
-#include "cmCommandArgumentsHelper.cxx"
-#include "cmCommands.h"
-#include "cmConfigureFileCommand.cxx"
-#include "cmContinueCommand.cxx"
-#include "cmCoreTryCompile.cxx"
-#include "cmCreateTestSourceList.cxx"
-#include "cmDefinePropertyCommand.cxx"
-#include "cmElseCommand.cxx"
-#include "cmEnableLanguageCommand.cxx"
-#include "cmEnableTestingCommand.cxx"
-#include "cmEndForEachCommand.cxx"
-#include "cmEndFunctionCommand.cxx"
-#include "cmEndIfCommand.cxx"
-#include "cmEndMacroCommand.cxx"
-#include "cmEndWhileCommand.cxx"
-#include "cmExecProgramCommand.cxx"
-#include "cmExecuteProcessCommand.cxx"
-#include "cmFileCommand.cxx"
-#include "cmFindBase.cxx"
-#include "cmFindCommon.cxx"
-#include "cmFindFileCommand.cxx"
-#include "cmFindLibraryCommand.cxx"
-#include "cmFindPackageCommand.cxx"
-#include "cmFindPathCommand.cxx"
-#include "cmFindProgramCommand.cxx"
-#include "cmForEachCommand.cxx"
-#include "cmFunctionCommand.cxx"
-#include "cmParseArgumentsCommand.cxx"
-#include "cmPathLabel.cxx"
-#include "cmSearchPath.cxx"
-
-void GetBootstrapCommands1(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 cmElseCommand);
-  commands.push_back(new cmEnableLanguageCommand);
-  commands.push_back(new cmEnableTestingCommand);
-  commands.push_back(new cmEndForEachCommand);
-  commands.push_back(new cmEndFunctionCommand);
-  commands.push_back(new cmEndIfCommand);
-  commands.push_back(new cmEndMacroCommand);
-  commands.push_back(new cmEndWhileCommand);
-  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 cmParseArgumentsCommand);
-}

+ 0 - 94
Source/cmBootstrapCommands2.cxx

@@ -1,94 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file Copyright.txt or https://cmake.org/licensing for details.  */
-// This file is used to compile all the commands
-// that CMake knows about at compile time.
-// This is sort of a boot strapping approach since you would
-// like to have CMake to build CMake.
-#include "cmCommands.h"
-#include "cmConditionEvaluator.cxx"
-#include "cmExpandedCommandArgument.cxx"
-#include "cmGetCMakePropertyCommand.cxx"
-#include "cmGetDirectoryPropertyCommand.cxx"
-#include "cmGetFilenameComponentCommand.cxx"
-#include "cmGetPropertyCommand.cxx"
-#include "cmGetSourceFilePropertyCommand.cxx"
-#include "cmGetTargetPropertyCommand.cxx"
-#include "cmGetTestPropertyCommand.cxx"
-#include "cmHexFileConverter.cxx"
-#include "cmIfCommand.cxx"
-#include "cmIncludeCommand.cxx"
-#include "cmIncludeDirectoryCommand.cxx"
-#include "cmIncludeRegularExpressionCommand.cxx"
-#include "cmInstallCommand.cxx"
-#include "cmInstallCommandArguments.cxx"
-#include "cmInstallFilesCommand.cxx"
-#include "cmInstallTargetsCommand.cxx"
-#include "cmLinkDirectoriesCommand.cxx"
-#include "cmListCommand.cxx"
-#include "cmMacroCommand.cxx"
-#include "cmMakeDirectoryCommand.cxx"
-#include "cmMarkAsAdvancedCommand.cxx"
-#include "cmMathCommand.cxx"
-#include "cmMessageCommand.cxx"
-#include "cmOptionCommand.cxx"
-#include "cmProjectCommand.cxx"
-#include "cmReturnCommand.cxx"
-#include "cmSeparateArgumentsCommand.cxx"
-#include "cmSetCommand.cxx"
-#include "cmSetDirectoryPropertiesCommand.cxx"
-#include "cmSetPropertyCommand.cxx"
-#include "cmSetSourceFilesPropertiesCommand.cxx"
-#include "cmSetTargetPropertiesCommand.cxx"
-#include "cmSetTestsPropertiesCommand.cxx"
-#include "cmSiteNameCommand.cxx"
-#include "cmStringCommand.cxx"
-#include "cmSubdirCommand.cxx"
-#include "cmTargetLinkLibrariesCommand.cxx"
-#include "cmTimestamp.cxx"
-#include "cmTryCompileCommand.cxx"
-#include "cmTryRunCommand.cxx"
-#include "cmUnsetCommand.cxx"
-#include "cmWhileCommand.cxx"
-
-void GetBootstrapCommands2(std::vector<cmCommand*>& commands)
-{
-  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 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 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 cmGetTestPropertyCommand);
-  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);
-}

+ 8 - 0
Source/cmBuildNameCommand.cxx

@@ -2,8 +2,16 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmBuildNameCommand.h"
 
+#include <algorithm>
 #include <cmsys/RegularExpression.hxx>
 
+#include "cmMakefile.h"
+#include "cmPolicies.h"
+#include "cmState.h"
+#include "cmSystemTools.h"
+
+class cmExecutionStatus;
+
 // cmBuildNameCommand
 bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args,
                                      cmExecutionStatus&)

+ 7 - 0
Source/cmBuildNameCommand.h

@@ -3,7 +3,14 @@
 #ifndef cmBuildNameCommand_h
 #define cmBuildNameCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 class cmBuildNameCommand : public cmCommand
 {

+ 7 - 0
Source/cmCMakeHostSystemInformationCommand.cxx

@@ -2,6 +2,13 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmCMakeHostSystemInformationCommand.h"
 
+#include <sstream>
+
+#include "cmMakefile.h"
+#include "cmsys/SystemInformation.hxx"
+
+class cmExecutionStatus;
+
 // cmCMakeHostSystemInformation
 bool cmCMakeHostSystemInformationCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 10 - 1
Source/cmCMakeHostSystemInformationCommand.h

@@ -3,9 +3,18 @@
 #ifndef cmCMakeHostSystemInformationCommand_h
 #define cmCMakeHostSystemInformationCommand_h
 
+#include <cmConfigure.h>
+#include <stddef.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
 
-#include <cmsys/SystemInformation.hxx>
+class cmExecutionStatus;
+namespace cmsys {
+class SystemInformation;
+} // namespace cmsys
 
 /** \class cmCMakeHostSystemInformationCommand
  * \brief Query host system specific information

+ 1 - 0
Source/cmCMakeMinimumRequired.cxx

@@ -2,6 +2,7 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmCMakeMinimumRequired.h"
 
+#include "cmSystemTools.h"
 #include "cmVersion.h"
 
 // cmCMakeMinimumRequired

+ 4 - 2
Source/cmCPluginAPI.cxx

@@ -7,10 +7,12 @@
 
 #include "cmCPluginAPI.h"
 
+#include "cmExecutionStatus.h"
+#include "cmGlobalGenerator.h"
 #include "cmMakefile.h"
-#include "cmVersion.h"
-
 #include "cmSourceFile.h"
+#include "cmState.h"
+#include "cmVersion.h"
 
 #include <stdlib.h>
 

+ 48 - 0
Source/cmCommand.cxx

@@ -0,0 +1,48 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#include "cmCommand.h"
+
+bool cmCommand::InvokeInitialPass(const std::vector<cmListFileArgument>& args,
+                                  cmExecutionStatus& status)
+{
+  std::vector<std::string> expandedArguments;
+  if (!this->Makefile->ExpandArguments(args, expandedArguments)) {
+    // There was an error expanding arguments.  It was already
+    // reported, so we can skip this command without error.
+    return true;
+  }
+  return this->InitialPass(expandedArguments, status);
+}
+
+const char* cmCommand::GetError()
+{
+  if (this->Error.empty()) {
+    this->Error = this->GetName();
+    this->Error += " unknown error.";
+  }
+  return this->Error.c_str();
+}
+
+void cmCommand::SetError(const std::string& 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;
+}

+ 6 - 42
Source/cmCommand.h

@@ -28,9 +28,9 @@ public:
    * Construct the command. By default it is enabled with no makefile.
    */
   cmCommand()
+    : Makefile(CM_NULLPTR)
+    , Enabled(true)
   {
-    this->Makefile = CM_NULLPTR;
-    this->Enabled = true;
   }
 
   /**
@@ -50,16 +50,7 @@ public:
    * arguments and then invokes the InitialPass.
    */
   virtual bool InvokeInitialPass(const std::vector<cmListFileArgument>& args,
-                                 cmExecutionStatus& status)
-  {
-    std::vector<std::string> expandedArguments;
-    if (!this->Makefile->ExpandArguments(args, expandedArguments)) {
-      // There was an error expanding arguments.  It was already
-      // reported, so we can skip this command without error.
-      return true;
-    }
-    return this->InitialPass(expandedArguments, status);
-  }
+                                 cmExecutionStatus& status);
 
   /**
    * This is called when the command is first encountered in
@@ -127,42 +118,15 @@ public:
   /**
    * Return the last error string.
    */
-  const char* GetError()
-  {
-    if (this->Error.empty()) {
-      this->Error = this->GetName();
-      this->Error += " unknown error.";
-    }
-    return this->Error.c_str();
-  }
+  const char* GetError();
 
   /**
    * Set the error message
    */
-  void SetError(const std::string& e)
-  {
-    this->Error = this->GetName();
-    this->Error += " ";
-    this->Error += e;
-  }
+  void SetError(const std::string& e);
 
   /** Check if the command is disallowed by a policy.  */
-  bool 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;
-  }
+  bool Disallowed(cmPolicies::PolicyID pol, const char* e);
 
 protected:
   cmMakefile* Makefile;

+ 238 - 0
Source/cmCommands.cxx

@@ -0,0 +1,238 @@
+/* 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 "cmAddCustomCommandCommand.h"
+#include "cmAddCustomTargetCommand.h"
+#include "cmAddDefinitionsCommand.h"
+#include "cmAddDependenciesCommand.h"
+#include "cmAddExecutableCommand.h"
+#include "cmAddLibraryCommand.h"
+#include "cmAddSubDirectoryCommand.h"
+#include "cmAddTestCommand.h"
+#include "cmBreakCommand.h"
+#include "cmBuildCommand.h"
+#include "cmCMakeMinimumRequired.h"
+#include "cmCMakePolicyCommand.h"
+#include "cmCommandArgumentsHelper.h"
+#include "cmConditionEvaluator.h"
+#include "cmConfigureFileCommand.h"
+#include "cmContinueCommand.h"
+#include "cmCoreTryCompile.h"
+#include "cmCreateTestSourceList.h"
+#include "cmDefinePropertyCommand.h"
+#include "cmElseCommand.h"
+#include "cmEnableLanguageCommand.h"
+#include "cmEnableTestingCommand.h"
+#include "cmEndForEachCommand.h"
+#include "cmEndFunctionCommand.h"
+#include "cmEndIfCommand.h"
+#include "cmEndMacroCommand.h"
+#include "cmEndWhileCommand.h"
+#include "cmExecProgramCommand.h"
+#include "cmExecuteProcessCommand.h"
+#include "cmExpandedCommandArgument.h"
+#include "cmFileCommand.h"
+#include "cmFindBase.h"
+#include "cmFindCommon.h"
+#include "cmFindFileCommand.h"
+#include "cmFindLibraryCommand.h"
+#include "cmFindPackageCommand.h"
+#include "cmFindPathCommand.h"
+#include "cmFindProgramCommand.h"
+#include "cmForEachCommand.h"
+#include "cmFunctionCommand.h"
+#include "cmGetCMakePropertyCommand.h"
+#include "cmGetDirectoryPropertyCommand.h"
+#include "cmGetFilenameComponentCommand.h"
+#include "cmGetPropertyCommand.h"
+#include "cmGetSourceFilePropertyCommand.h"
+#include "cmGetTargetPropertyCommand.h"
+#include "cmGetTestPropertyCommand.h"
+#include "cmHexFileConverter.h"
+#include "cmIfCommand.h"
+#include "cmIncludeCommand.h"
+#include "cmIncludeDirectoryCommand.h"
+#include "cmIncludeRegularExpressionCommand.h"
+#include "cmInstallCommand.h"
+#include "cmInstallCommandArguments.h"
+#include "cmInstallFilesCommand.h"
+#include "cmInstallTargetsCommand.h"
+#include "cmLinkDirectoriesCommand.h"
+#include "cmListCommand.h"
+#include "cmMacroCommand.h"
+#include "cmMakeDirectoryCommand.h"
+#include "cmMarkAsAdvancedCommand.h"
+#include "cmMathCommand.h"
+#include "cmMessageCommand.h"
+#include "cmOptionCommand.h"
+#include "cmParseArgumentsCommand.h"
+#include "cmPathLabel.h"
+#include "cmProjectCommand.h"
+#include "cmReturnCommand.h"
+#include "cmSearchPath.h"
+#include "cmSeparateArgumentsCommand.h"
+#include "cmSetCommand.h"
+#include "cmSetDirectoryPropertiesCommand.h"
+#include "cmSetPropertyCommand.h"
+#include "cmSetSourceFilesPropertiesCommand.h"
+#include "cmSetTargetPropertiesCommand.h"
+#include "cmSetTestsPropertiesCommand.h"
+#include "cmSiteNameCommand.h"
+#include "cmStringCommand.h"
+#include "cmSubdirCommand.h"
+#include "cmTargetLinkLibrariesCommand.h"
+#include "cmTimestamp.h"
+#include "cmTryCompileCommand.h"
+#include "cmTryRunCommand.h"
+#include "cmUnsetCommand.h"
+#include "cmWhileCommand.h"
+
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+#include "cmAddCompileOptionsCommand.h"
+#include "cmAuxSourceDirectoryCommand.h"
+#include "cmBuildNameCommand.h"
+#include "cmCMakeHostSystemInformationCommand.h"
+#include "cmElseIfCommand.h"
+#include "cmExportCommand.h"
+#include "cmExportLibraryDependenciesCommand.h"
+#include "cmFLTKWrapUICommand.h"
+#include "cmIncludeExternalMSProjectCommand.h"
+#include "cmInstallProgramsCommand.h"
+#include "cmLinkLibrariesCommand.h"
+#include "cmLoadCacheCommand.h"
+#include "cmLoadCommandCommand.h"
+#include "cmOutputRequiredFilesCommand.h"
+#include "cmQTWrapCPPCommand.h"
+#include "cmQTWrapUICommand.h"
+#include "cmRemoveCommand.h"
+#include "cmRemoveDefinitionsCommand.h"
+#include "cmSourceGroupCommand.h"
+#include "cmSubdirDependsCommand.h"
+#include "cmTargetCompileDefinitionsCommand.h"
+#include "cmTargetCompileFeaturesCommand.h"
+#include "cmTargetCompileOptionsCommand.h"
+#include "cmTargetIncludeDirectoriesCommand.h"
+#include "cmTargetPropCommandBase.h"
+#include "cmTargetSourcesCommand.h"
+#include "cmUseMangledMesaCommand.h"
+#include "cmUtilitySourceCommand.h"
+#include "cmVariableRequiresCommand.h"
+#include "cmVariableWatchCommand.h"
+#include "cmWriteFileCommand.h"
+#endif
+
+std::vector<cmCommand*> GetPredefinedCommands()
+{
+  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 cmElseCommand);
+  commands.push_back(new cmEnableLanguageCommand);
+  commands.push_back(new cmEnableTestingCommand);
+  commands.push_back(new cmEndForEachCommand);
+  commands.push_back(new cmEndFunctionCommand);
+  commands.push_back(new cmEndIfCommand);
+  commands.push_back(new cmEndMacroCommand);
+  commands.push_back(new cmEndWhileCommand);
+  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);
+
+#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 cmElseIfCommand);
+  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
+
+  return commands;
+}

+ 0 - 10
Source/cmCommands.cxx.in

@@ -1,10 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file Copyright.txt or https://cmake.org/licensing for details.  */
-#include "cmCommands.h"
-
-@COMMAND_INCLUDES@
-
-void GetPredefinedCommands(std::vector<cmCommand*>& commands)
-{
-@NEW_COMMANDS@
-}

+ 3 - 7
Source/cmCommands.h

@@ -10,13 +10,9 @@
 class cmCommand;
 /**
  * Global function to return all compiled in commands.
- * To add a new command edit cmCommands.cxx or cmBootstrapCommands[12].cxx
- * and add your command.
- * It is up to the caller to delete the commands created by this
- * call.
+ * 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 GetBootstrapCommands1(std::vector<cmCommand*>& commands);
-void GetBootstrapCommands2(std::vector<cmCommand*>& commands);
-void GetPredefinedCommands(std::vector<cmCommand*>& commands);
+std::vector<cmCommand*> GetPredefinedCommands();
 
 #endif

+ 0 - 7
Source/cmCommandsForBootstrap.cxx

@@ -1,7 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file Copyright.txt or https://cmake.org/licensing for details.  */
-#include "cmCommands.h"
-
-void GetPredefinedCommands(std::vector<cmCommand*>&)
-{
-}

+ 6 - 6
Source/cmConditionEvaluator.cxx

@@ -222,7 +222,7 @@ bool cmConditionEvaluator::GetBooleanValue(
     double d = strtod(arg.c_str(), &end);
     if (*end == '\0') {
       // The whole string is a number.  Use C conversion to bool.
-      return d ? true : false;
+      return static_cast<bool>(d);
     }
   }
 
@@ -444,7 +444,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
       if (this->IsKeyword(keyCOMMAND, *arg) && argP1 != newArgs.end()) {
         cmCommand* command =
           this->Makefile.GetState()->GetCommand(argP1->c_str());
-        this->HandlePredicate(command ? true : false, reducible, arg, newArgs,
+        this->HandlePredicate(command != CM_NULLPTR, reducible, arg, newArgs,
                               argP1, argP2);
       }
       // does a policy exist
@@ -456,7 +456,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
       // does a target exist
       if (this->IsKeyword(keyTARGET, *arg) && argP1 != newArgs.end()) {
         this->HandlePredicate(
-          this->Makefile.FindTargetToUse(argP1->GetValue()) ? true : false,
+          this->Makefile.FindTargetToUse(argP1->GetValue()) != CM_NULLPTR,
           reducible, arg, newArgs, argP1, argP2);
       }
       // does a test exist
@@ -464,7 +464,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
           this->Policy64Status != cmPolicies::WARN) {
         if (this->IsKeyword(keyTEST, *arg) && argP1 != newArgs.end()) {
           const cmTest* haveTest = this->Makefile.GetTest(argP1->c_str());
-          this->HandlePredicate(haveTest ? true : false, reducible, arg,
+          this->HandlePredicate(haveTest != CM_NULLPTR, reducible, arg,
                                 newArgs, argP1, argP2);
         }
       } else if (this->Policy64Status == cmPolicies::WARN &&
@@ -638,8 +638,8 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
         bool success = cmSystemTools::FileTimeCompare(
           arg->GetValue(), (argP2)->GetValue(), &fileIsNewer);
         this->HandleBinaryOp(
-          (success == false || fileIsNewer == 1 || fileIsNewer == 0),
-          reducible, arg, newArgs, argP1, argP2);
+          (!success || fileIsNewer == 1 || fileIsNewer == 0), reducible, arg,
+          newArgs, argP1, argP2);
       }
 
       if (argP1 != newArgs.end() && argP2 != newArgs.end() &&

+ 2 - 0
Source/cmConfigureFileCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmConfigureFileCommand.h"
 
+#include "cmSystemTools.h"
+
 #include <cmsys/RegularExpression.hxx>
 
 // cmConfigureFileCommand

+ 3 - 0
Source/cmContinueCommand.cxx

@@ -2,6 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmContinueCommand.h"
 
+#include "cmExecutionStatus.h"
+#include "cmSystemTools.h"
+
 // cmContinueCommand
 bool cmContinueCommand::InitialPass(std::vector<std::string> const& args,
                                     cmExecutionStatus& status)

+ 1 - 0
Source/cmCreateTestSourceList.cxx

@@ -3,6 +3,7 @@
 #include "cmCreateTestSourceList.h"
 
 #include "cmSourceFile.h"
+#include "cmSystemTools.h"
 
 // cmCreateTestSourceList
 bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& args,

+ 2 - 0
Source/cmElseIfCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmElseIfCommand.h"
 
+class cmExecutionStatus;
+
 bool cmElseIfCommand::InitialPass(std::vector<std::string> const&,
                                   cmExecutionStatus&)
 {

+ 8 - 1
Source/cmElseIfCommand.h

@@ -3,7 +3,14 @@
 #ifndef cmElseIfCommand_h
 #define cmElseIfCommand_h
 
-#include "cmIfCommand.h"
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
+#include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 /** \class cmElseIfCommand
  * \brief ends an if block

+ 13 - 5
Source/cmExportCommand.cxx

@@ -2,15 +2,22 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmExportCommand.h"
 
-#include "cmGeneratedFileStream.h"
-#include "cmGlobalGenerator.h"
-#include "cmake.h"
-
-#include <cmsys/Encoding.hxx>
 #include <cmsys/RegularExpression.hxx>
+#include <map>
+#include <sstream>
 
 #include "cmExportBuildAndroidMKGenerator.h"
 #include "cmExportBuildFileGenerator.h"
+#include "cmExportSetMap.h"
+#include "cmGeneratedFileStream.h"
+#include "cmGlobalGenerator.h"
+#include "cmMakefile.h"
+#include "cmState.h"
+#include "cmSystemTools.h"
+#include "cmTarget.h"
+#include "cmake.h"
+
+class cmExecutionStatus;
 
 #if defined(__HAIKU__)
 #include <FindDirectory.h>
@@ -271,6 +278,7 @@ bool cmExportCommand::HandlePackage(std::vector<std::string> const& args)
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #include <windows.h>
+
 #undef GetCurrentDirectory
 void cmExportCommand::ReportRegistryError(std::string const& msg,
                                           std::string const& key, long err)

+ 7 - 1
Source/cmExportCommand.h

@@ -3,9 +3,15 @@
 #ifndef cmExportCommand_h
 #define cmExportCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmCommandArgumentsHelper.h"
+#include "cmTypeMacro.h"
 
-class cmExportBuildFileGenerator;
+class cmExecutionStatus;
 class cmExportSet;
 
 /** \class cmExportLibraryDependenciesCommand

+ 10 - 2
Source/cmExportLibraryDependenciesCommand.cxx

@@ -2,12 +2,20 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmExportLibraryDependenciesCommand.h"
 
+#include <cm_auto_ptr.hxx>
+#include <cmsys/FStream.hxx>
+
 #include "cmGeneratedFileStream.h"
 #include "cmGlobalGenerator.h"
-#include "cmVersion.h"
+#include "cmMakefile.h"
+#include "cmPolicies.h"
+#include "cmState.h"
+#include "cmSystemTools.h"
+#include "cmTarget.h"
+#include "cmTargetLinkLibraryType.h"
 #include "cmake.h"
 
-#include <cm_auto_ptr.hxx>
+class cmExecutionStatus;
 
 bool cmExportLibraryDependenciesCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 7 - 0
Source/cmExportLibraryDependenciesCommand.h

@@ -3,7 +3,14 @@
 #ifndef cmExportLibraryDependenciesCommand_h
 #define cmExportLibraryDependenciesCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 class cmExportLibraryDependenciesCommand : public cmCommand
 {

+ 8 - 0
Source/cmFLTKWrapUICommand.cxx

@@ -2,7 +2,15 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmFLTKWrapUICommand.h"
 
+#include <stddef.h>
+
+#include "cmCustomCommandLines.h"
+#include "cmMakefile.h"
 #include "cmSourceFile.h"
+#include "cmSystemTools.h"
+
+class cmExecutionStatus;
+class cmTarget;
 
 // cmFLTKWrapUICommand
 bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args,

+ 8 - 0
Source/cmFLTKWrapUICommand.h

@@ -3,7 +3,15 @@
 #ifndef cmFLTKWrapUICommand_h
 #define cmFLTKWrapUICommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
+class cmSourceFile;
 
 /** \class cmFLTKWrapUICommand
  * \brief Create .h and .cxx files rules for FLTK user interfaces files

+ 2 - 6
Source/cmFileCommand.cxx

@@ -2449,18 +2449,14 @@ public:
   {
   }
 
-  ~cURLEasyGuard(void)
+  ~cURLEasyGuard()
   {
     if (this->Easy) {
       ::curl_easy_cleanup(this->Easy);
     }
   }
 
-  inline void release(void)
-  {
-    this->Easy = CM_NULLPTR;
-    return;
-  }
+  void release() { this->Easy = CM_NULLPTR; }
 
 private:
   ::CURL* Easy;

+ 2 - 1
Source/cmFindBase.cxx

@@ -5,6 +5,7 @@
 #include "cmAlgorithms.h"
 #include "cmState.h"
 #include "cmStateTypes.h"
+#include "cmSystemTools.h"
 
 cmFindBase::cmFindBase()
 {
@@ -301,7 +302,7 @@ bool cmFindBase::CheckForVariableInCache()
     cmState* state = this->Makefile->GetState();
     const char* cacheEntry = state->GetCacheEntryValue(this->VariableName);
     bool found = !cmSystemTools::IsNOTFOUND(cacheValue);
-    bool cached = cacheEntry ? true : false;
+    bool cached = cacheEntry != CM_NULLPTR;
     if (found) {
       // If the user specifies the entry on the command line without a
       // type we should add the type and docstring but keep the

+ 2 - 0
Source/cmFindCommon.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmFindCommon.h"
 
+#include "cmSystemTools.h"
+
 #include <algorithm>
 #include <functional>
 

+ 4 - 0
Source/cmFindLibraryCommand.cxx

@@ -2,7 +2,11 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmFindLibraryCommand.h"
 
+#include "cmGlobalGenerator.h"
 #include "cmState.h"
+#include "cmSystemTools.h"
+#include "cmVersion.h"
+
 #include <cmsys/Directory.hxx>
 
 cmFindLibraryCommand::cmFindLibraryCommand()

+ 10 - 9
Source/cmFindPackageCommand.cxx

@@ -4,9 +4,12 @@
 
 #include "cmAlgorithms.h"
 #include "cmState.h"
+#include "cmVersion.h"
+
 #include <cmSystemTools.h>
 #include <cmsys/Directory.hxx>
 #include <cmsys/Encoding.hxx>
+#include <cmsys/FStream.hxx>
 #include <cmsys/RegularExpression.hxx>
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
@@ -670,8 +673,8 @@ bool cmFindPackageCommand::HandlePackageMode()
   bool configFileSetFOUNDFalse = false;
 
   if (fileFound) {
-    if ((this->Makefile->IsDefinitionSet(foundVar)) &&
-        (this->Makefile->IsOn(foundVar) == false)) {
+    if (this->Makefile->IsDefinitionSet(foundVar) &&
+        !this->Makefile->IsOn(foundVar)) {
       // by removing Foo_FOUND here if it is FALSE, we don't really change
       // the situation for the Config file which is about to be included,
       // but we make it possible to detect later on whether the Config file
@@ -690,8 +693,8 @@ bool cmFindPackageCommand::HandlePackageMode()
       found = true;
 
       // Check whether the Config file has set Foo_FOUND to FALSE:
-      if ((this->Makefile->IsDefinitionSet(foundVar)) &&
-          (this->Makefile->IsOn(foundVar) == false)) {
+      if (this->Makefile->IsDefinitionSet(foundVar) &&
+          !this->Makefile->IsOn(foundVar)) {
         // we get here if the Config file has set Foo_FOUND actively to FALSE
         found = false;
         configFileSetFOUNDFalse = true;
@@ -1413,8 +1416,7 @@ bool cmFindPackageCommand::CheckVersion(std::string const& config_file)
   // Look for foo-config-version.cmake
   std::string version_file = version_file_base;
   version_file += "-version.cmake";
-  if ((haveResult == false) &&
-      (cmSystemTools::FileExists(version_file.c_str(), true))) {
+  if (!haveResult && cmSystemTools::FileExists(version_file.c_str(), true)) {
     result = this->CheckVersionFile(version_file, version);
     haveResult = true;
   }
@@ -1422,14 +1424,13 @@ bool cmFindPackageCommand::CheckVersion(std::string const& config_file)
   // Look for fooConfigVersion.cmake
   version_file = version_file_base;
   version_file += "Version.cmake";
-  if ((haveResult == false) &&
-      (cmSystemTools::FileExists(version_file.c_str(), true))) {
+  if (!haveResult && cmSystemTools::FileExists(version_file.c_str(), true)) {
     result = this->CheckVersionFile(version_file, version);
     haveResult = true;
   }
 
   // If no version was requested a versionless package is acceptable.
-  if ((haveResult == false) && (this->Version.empty())) {
+  if (!haveResult && this->Version.empty()) {
     result = true;
   }
 

+ 2 - 0
Source/cmFindPathCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmFindPathCommand.h"
 
+#include "cmSystemTools.h"
+
 #include <cmsys/Glob.hxx>
 
 cmFindPathCommand::cmFindPathCommand()

+ 2 - 0
Source/cmFindProgramCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmFindProgramCommand.h"
 
+#include "cmSystemTools.h"
+
 #include <stdlib.h>
 
 #if defined(__APPLE__)

+ 2 - 0
Source/cmForEachCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmForEachCommand.h"
 
+#include "cmSystemTools.h"
+
 #include <cm_auto_ptr.hxx>
 
 cmForEachFunctionBlocker::cmForEachFunctionBlocker(cmMakefile* mf)

+ 2 - 0
Source/cmFunctionCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmFunctionCommand.h"
 
+#include "cmState.h"
+#include "cmSystemTools.h"
 #include "cmake.h"
 
 // define the class for function commands

+ 1 - 0
Source/cmGetCMakePropertyCommand.cxx

@@ -4,6 +4,7 @@
 
 #include "cmAlgorithms.h"
 #include "cmGlobalGenerator.h"
+#include "cmState.h"
 #include "cmStateTypes.h"
 #include "cmake.h"
 

+ 2 - 0
Source/cmGetDirectoryPropertyCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmGetDirectoryPropertyCommand.h"
 
+#include "cmGlobalGenerator.h"
+#include "cmSystemTools.h"
 #include "cmake.h"
 
 // cmGetDirectoryPropertyCommand

+ 3 - 1
Source/cmHexFileConverter.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmHexFileConverter.h"
 
+#include "cmSystemTools.h"
+
 #include <stdio.h>
 #include <string.h>
 
@@ -204,7 +206,7 @@ bool cmHexFileConverter::TryConvert(const char* inFileName,
     } else if (type == IntelHex) {
       success = ConvertIntelHexLine(buf, outFile);
     }
-    if (success == false) {
+    if (!success) {
       break;
     }
   }

+ 1 - 0
Source/cmIfCommand.cxx

@@ -4,6 +4,7 @@
 
 #include "cmOutputConverter.h"
 #include "cmStringCommand.h"
+#include "cmSystemTools.h"
 
 #include "cmConditionEvaluator.h"
 

+ 3 - 0
Source/cmIncludeCommand.cxx

@@ -2,6 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmIncludeCommand.h"
 
+#include "cmGlobalGenerator.h"
+#include "cmSystemTools.h"
+
 // cmIncludeCommand
 bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
                                    cmExecutionStatus&)

+ 2 - 0
Source/cmIncludeDirectoryCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmIncludeDirectoryCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmIncludeDirectoryCommand
 bool cmIncludeDirectoryCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 6 - 0
Source/cmIncludeExternalMSProjectCommand.cxx

@@ -2,6 +2,12 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmIncludeExternalMSProjectCommand.h"
 
+#ifdef _WIN32
+#include "cmSystemTools.h"
+#endif
+
+class cmExecutionStatus;
+
 // cmIncludeExternalMSProjectCommand
 bool cmIncludeExternalMSProjectCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 7 - 0
Source/cmIncludeExternalMSProjectCommand.h

@@ -3,7 +3,14 @@
 #ifndef cmIncludeExternalMSProjectCommand_h
 #define cmIncludeExternalMSProjectCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 /** \class cmIncludeExternalMSProjectCommand
  * \brief Specify an external MS project file for inclusion in the workspace.

+ 2 - 0
Source/cmInstallCommand.cxx

@@ -3,12 +3,14 @@
 #include "cmInstallCommand.h"
 
 #include "cmExportSet.h"
+#include "cmGlobalGenerator.h"
 #include "cmInstallCommandArguments.h"
 #include "cmInstallDirectoryGenerator.h"
 #include "cmInstallExportGenerator.h"
 #include "cmInstallFilesGenerator.h"
 #include "cmInstallScriptGenerator.h"
 #include "cmInstallTargetGenerator.h"
+#include "cmSystemTools.h"
 #include "cmTargetExport.h"
 
 #include <cmsys/Glob.hxx>

+ 2 - 0
Source/cmInstallFilesCommand.cxx

@@ -2,7 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmInstallFilesCommand.h"
 
+#include "cmGlobalGenerator.h"
 #include "cmInstallFilesGenerator.h"
+#include "cmSystemTools.h"
 
 // cmExecutableCommand
 bool cmInstallFilesCommand::InitialPass(std::vector<std::string> const& args,

+ 8 - 0
Source/cmInstallProgramsCommand.cxx

@@ -2,7 +2,15 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmInstallProgramsCommand.h"
 
+#include "cmGeneratorExpression.h"
+#include "cmGlobalGenerator.h"
 #include "cmInstallFilesGenerator.h"
+#include "cmInstallGenerator.h"
+#include "cmMakefile.h"
+#include "cmSystemTools.h"
+
+class cmExecutionStatus;
+
 // cmExecutableCommand
 bool cmInstallProgramsCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 7 - 0
Source/cmInstallProgramsCommand.h

@@ -3,7 +3,14 @@
 #ifndef cmInstallProgramsCommand_h
 #define cmInstallProgramsCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 /** \class cmInstallProgramsCommand
  * \brief Specifies where to install some programs

+ 2 - 0
Source/cmInstallTargetsCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmInstallTargetsCommand.h"
 
+#include "cmGlobalGenerator.h"
+
 // cmExecutableCommand
 bool cmInstallTargetsCommand::InitialPass(std::vector<std::string> const& args,
                                           cmExecutionStatus&)

+ 2 - 0
Source/cmLinkDirectoriesCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmLinkDirectoriesCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmLinkDirectoriesCommand
 bool cmLinkDirectoriesCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 4 - 0
Source/cmLinkLibrariesCommand.cxx

@@ -2,6 +2,10 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmLinkLibrariesCommand.h"
 
+#include "cmMakefile.h"
+
+class cmExecutionStatus;
+
 // cmLinkLibrariesCommand
 bool cmLinkLibrariesCommand::InitialPass(std::vector<std::string> const& args,
                                          cmExecutionStatus&)

+ 7 - 0
Source/cmLinkLibrariesCommand.h

@@ -3,7 +3,14 @@
 #ifndef cmLinkLibrariesCommand_h
 #define cmLinkLibrariesCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 /** \class cmLinkLibrariesCommand
  * \brief Specify a list of libraries to link into executables.

+ 1 - 0
Source/cmListCommand.cxx

@@ -3,6 +3,7 @@
 #include "cmListCommand.h"
 
 #include "cmAlgorithms.h"
+#include "cmSystemTools.h"
 #include <cmsys/RegularExpression.hxx>
 #include <cmsys/SystemTools.hxx>
 

+ 7 - 1
Source/cmLoadCacheCommand.cxx

@@ -3,7 +3,13 @@
 #include "cmLoadCacheCommand.h"
 
 #include <cmsys/FStream.hxx>
-#include <cmsys/RegularExpression.hxx>
+
+#include "cmMakefile.h"
+#include "cmState.h"
+#include "cmSystemTools.h"
+#include "cmake.h"
+
+class cmExecutionStatus;
 
 // cmLoadCacheCommand
 bool cmLoadCacheCommand::InitialPass(std::vector<std::string> const& args,

+ 8 - 0
Source/cmLoadCacheCommand.h

@@ -3,7 +3,15 @@
 #ifndef cmLoadCacheCommand_h
 #define cmLoadCacheCommand_h
 
+#include <cmConfigure.h>
+#include <set>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 /** \class cmLoadCacheCommand
  * \brief load a cache file

+ 10 - 3
Source/cmLoadCommandCommand.cxx

@@ -5,16 +5,23 @@
 #include "cmCPluginAPI.cxx"
 #include "cmCPluginAPI.h"
 #include "cmDynamicLoader.h"
+#include "cmMakefile.h"
+#include "cmPolicies.h"
+#include "cmState.h"
+#include "cmSystemTools.h"
 
-#include <cmsys/DynamicLoader.hxx>
+class cmExecutionStatus;
 
+#include <signal.h>
+#include <sstream>
+#include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #ifdef __QNX__
 #include <malloc.h> /* for malloc/free on QNX */
 #endif
 
-#include <signal.h>
 extern "C" void TrapsForSignalsCFunction(int sig);
 
 // a class for loadabple commands
@@ -57,7 +64,7 @@ public:
   void FinalPass() CM_OVERRIDE;
   bool HasFinalPass() const CM_OVERRIDE
   {
-    return this->info.FinalPass ? true : false;
+    return this->info.FinalPass != CM_NULLPTR;
   }
 
   /**

+ 7 - 0
Source/cmLoadCommandCommand.h

@@ -3,7 +3,14 @@
 #ifndef cmLoadCommandCommand_h
 #define cmLoadCommandCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 class cmLoadCommandCommand : public cmCommand
 {

+ 2 - 0
Source/cmMacroCommand.cxx

@@ -3,6 +3,8 @@
 #include "cmMacroCommand.h"
 
 #include "cmAlgorithms.h"
+#include "cmState.h"
+#include "cmSystemTools.h"
 #include "cmake.h"
 
 // define the class for macro commands

+ 2 - 0
Source/cmMakeDirectoryCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmMakeDirectoryCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmMakeDirectoryCommand
 bool cmMakeDirectoryCommand::InitialPass(std::vector<std::string> const& args,
                                          cmExecutionStatus&)

+ 3 - 0
Source/cmMarkAsAdvancedCommand.cxx

@@ -2,6 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmMarkAsAdvancedCommand.h"
 
+#include "cmState.h"
+#include "cmSystemTools.h"
+
 // cmMarkAsAdvancedCommand
 bool cmMarkAsAdvancedCommand::InitialPass(std::vector<std::string> const& args,
                                           cmExecutionStatus&)

+ 1 - 0
Source/cmMessageCommand.cxx

@@ -3,6 +3,7 @@
 #include "cmMessageCommand.h"
 
 #include "cmMessenger.h"
+#include "cmSystemTools.h"
 
 // cmLibraryCommand
 bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,

+ 3 - 0
Source/cmOptionCommand.cxx

@@ -2,6 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmOptionCommand.h"
 
+#include "cmState.h"
+#include "cmSystemTools.h"
+
 // cmOptionCommand
 bool cmOptionCommand::InitialPass(std::vector<std::string> const& args,
                                   cmExecutionStatus&)

+ 11 - 1
Source/cmOutputRequiredFilesCommand.cxx

@@ -2,8 +2,18 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmOutputRequiredFilesCommand.h"
 
-#include "cmAlgorithms.h"
 #include <cmsys/FStream.hxx>
+#include <cmsys/RegularExpression.hxx>
+
+#include "cmAlgorithms.h"
+#include "cmGeneratorExpression.h"
+#include "cmMakefile.h"
+#include "cmPolicies.h"
+#include "cmSourceFile.h"
+#include "cmSystemTools.h"
+#include "cmTarget.h"
+
+class cmExecutionStatus;
 
 /** \class cmDependInformation
  * \brief Store dependency information for a single source file.

+ 8 - 0
Source/cmOutputRequiredFilesCommand.h

@@ -3,9 +3,17 @@
 #ifndef cmOutputRequiredFilesCommand_h
 #define cmOutputRequiredFilesCommand_h
 
+#include <cmConfigure.h>
+#include <set>
+#include <stdio.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
 
 class cmDependInformation;
+class cmExecutionStatus;
 
 class cmOutputRequiredFilesCommand : public cmCommand
 {

+ 1 - 0
Source/cmParseArgumentsCommand.cxx

@@ -3,6 +3,7 @@
 #include "cmParseArgumentsCommand.h"
 
 #include "cmAlgorithms.h"
+#include "cmSystemTools.h"
 
 static std::string escape_arg(const std::string& arg)
 {

+ 2 - 0
Source/cmProjectCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmProjectCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmProjectCommand
 bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
                                    cmExecutionStatus&)

+ 7 - 0
Source/cmQTWrapCPPCommand.cxx

@@ -2,6 +2,13 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmQTWrapCPPCommand.h"
 
+#include "cmCustomCommandLines.h"
+#include "cmMakefile.h"
+#include "cmSourceFile.h"
+#include "cmSystemTools.h"
+
+class cmExecutionStatus;
+
 // cmQTWrapCPPCommand
 bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& args,
                                      cmExecutionStatus&)

+ 6 - 1
Source/cmQTWrapCPPCommand.h

@@ -3,9 +3,14 @@
 #ifndef cmQTWrapCPPCommand_h
 #define cmQTWrapCPPCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
 
-#include "cmSourceFile.h"
+class cmExecutionStatus;
 
 /** \class cmQTWrapCPPCommand
  * \brief Create moc file rules for Qt classes

+ 7 - 0
Source/cmQTWrapUICommand.cxx

@@ -2,6 +2,13 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmQTWrapUICommand.h"
 
+#include "cmCustomCommandLines.h"
+#include "cmMakefile.h"
+#include "cmSourceFile.h"
+#include "cmSystemTools.h"
+
+class cmExecutionStatus;
+
 // cmQTWrapUICommand
 bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args,
                                     cmExecutionStatus&)

+ 6 - 1
Source/cmQTWrapUICommand.h

@@ -3,9 +3,14 @@
 #ifndef cmQTWrapUICommand_h
 #define cmQTWrapUICommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
 
-#include "cmSourceFile.h"
+class cmExecutionStatus;
 
 /** \class cmQTWrapUICommand
  * \brief Create .h and .cxx files rules for Qt user interfaces files

+ 5 - 0
Source/cmRemoveCommand.cxx

@@ -2,6 +2,11 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmRemoveCommand.h"
 
+#include "cmMakefile.h"
+#include "cmSystemTools.h"
+
+class cmExecutionStatus;
+
 // cmRemoveCommand
 bool cmRemoveCommand::InitialPass(std::vector<std::string> const& args,
                                   cmExecutionStatus&)

+ 7 - 0
Source/cmRemoveCommand.h

@@ -3,7 +3,14 @@
 #ifndef cmRemoveCommand_h
 #define cmRemoveCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 /** \class cmRemoveCommand
  * \brief remove command

+ 4 - 0
Source/cmRemoveDefinitionsCommand.cxx

@@ -2,6 +2,10 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmRemoveDefinitionsCommand.h"
 
+#include "cmMakefile.h"
+
+class cmExecutionStatus;
+
 // cmRemoveDefinitionsCommand
 bool cmRemoveDefinitionsCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 7 - 0
Source/cmRemoveDefinitionsCommand.h

@@ -3,7 +3,14 @@
 #ifndef cmRemoveDefinitionsCommand_h
 #define cmRemoveDefinitionsCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 /** \class cmRemoveDefinitionsCommand
  * \brief Specify a list of compiler defines

+ 2 - 0
Source/cmReturnCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmReturnCommand.h"
 
+#include "cmExecutionStatus.h"
+
 // cmReturnCommand
 bool cmReturnCommand::InitialPass(std::vector<std::string> const&,
                                   cmExecutionStatus& status)

+ 1 - 0
Source/cmSearchPath.cxx

@@ -4,6 +4,7 @@
 
 #include "cmAlgorithms.h"
 #include "cmFindCommon.h"
+#include "cmSystemTools.h"
 
 cmSearchPath::cmSearchPath(cmFindCommon* findCmd)
   : FC(findCmd)

+ 2 - 0
Source/cmSeparateArgumentsCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmSeparateArgumentsCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmSeparateArgumentsCommand
 bool cmSeparateArgumentsCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 3 - 0
Source/cmSetCommand.cxx

@@ -2,6 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmSetCommand.h"
 
+#include "cmState.h"
+#include "cmSystemTools.h"
+
 // cmSetCommand
 bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
                                cmExecutionStatus&)

+ 4 - 0
Source/cmSetPropertyCommand.cxx

@@ -2,9 +2,13 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmSetPropertyCommand.h"
 
+#include "cmGlobalGenerator.h"
 #include "cmSetSourceFilesPropertiesCommand.h"
 #include "cmSetTargetPropertiesCommand.h"
 #include "cmSetTestsPropertiesCommand.h"
+#include "cmSourceFile.h"
+#include "cmState.h"
+#include "cmTest.h"
 
 cmSetPropertyCommand::cmSetPropertyCommand()
 {

+ 1 - 0
Source/cmSetSourceFilesPropertiesCommand.cxx

@@ -3,6 +3,7 @@
 #include "cmSetSourceFilesPropertiesCommand.h"
 
 #include "cmSourceFile.h"
+#include "cmSystemTools.h"
 
 // cmSetSourceFilesPropertiesCommand
 bool cmSetSourceFilesPropertiesCommand::InitialPass(

+ 2 - 0
Source/cmSiteNameCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmSiteNameCommand.h"
 
+#include "cmSystemTools.h"
+
 #include <cmsys/RegularExpression.hxx>
 
 // cmSiteNameCommand

+ 8 - 0
Source/cmSourceGroupCommand.cxx

@@ -2,6 +2,14 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmSourceGroupCommand.h"
 
+#include <sstream>
+
+#include "cmMakefile.h"
+#include "cmSourceGroup.h"
+#include "cmSystemTools.h"
+
+class cmExecutionStatus;
+
 // cmSourceGroupCommand
 bool cmSourceGroupCommand::InitialPass(std::vector<std::string> const& args,
                                        cmExecutionStatus&)

+ 7 - 0
Source/cmSourceGroupCommand.h

@@ -3,7 +3,14 @@
 #ifndef cmSourceGroupCommand_h
 #define cmSourceGroupCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 /** \class cmSourceGroupCommand
  * \brief Adds a cmSourceGroup to the cmMakefile.

+ 1 - 0
Source/cmStringCommand.cxx

@@ -3,6 +3,7 @@
 #include "cmStringCommand.h"
 
 #include "cmCryptoHash.h"
+#include "cmSystemTools.h"
 
 #include <cmsys/RegularExpression.hxx>
 #include <cmsys/SystemTools.hxx>

+ 2 - 0
Source/cmSubdirCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmSubdirCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmSubdirCommand
 bool cmSubdirCommand::InitialPass(std::vector<std::string> const& args,
                                   cmExecutionStatus&)

+ 4 - 0
Source/cmSubdirDependsCommand.cxx

@@ -2,6 +2,10 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmSubdirDependsCommand.h"
 
+#include "cmPolicies.h"
+
+class cmExecutionStatus;
+
 bool cmSubdirDependsCommand::InitialPass(std::vector<std::string> const&,
                                          cmExecutionStatus&)
 {

+ 7 - 0
Source/cmSubdirDependsCommand.h

@@ -3,7 +3,14 @@
 #ifndef cmSubdirDependsCommand_h
 #define cmSubdirDependsCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmCommand.h"
+#include "cmTypeMacro.h"
+
+class cmExecutionStatus;
 
 class cmSubdirDependsCommand : public cmCommand
 {

+ 7 - 0
Source/cmTargetCompileDefinitionsCommand.cxx

@@ -2,7 +2,14 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmTargetCompileDefinitionsCommand.h"
 
+#include <sstream>
+
 #include "cmAlgorithms.h"
+#include "cmMakefile.h"
+#include "cmTarget.h"
+#include "cmake.h"
+
+class cmExecutionStatus;
 
 bool cmTargetCompileDefinitionsCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 9 - 0
Source/cmTargetCompileDefinitionsCommand.h

@@ -3,7 +3,16 @@
 #ifndef cmTargetCompileDefinitionsCommand_h
 #define cmTargetCompileDefinitionsCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmTargetPropCommandBase.h"
+#include "cmTypeMacro.h"
+
+class cmCommand;
+class cmExecutionStatus;
+class cmTarget;
 
 class cmTargetCompileDefinitionsCommand : public cmTargetPropCommandBase
 {

+ 8 - 0
Source/cmTargetCompileFeaturesCommand.cxx

@@ -2,7 +2,15 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmTargetCompileFeaturesCommand.h"
 
+#include <algorithm>
+#include <sstream>
+
 #include "cmAlgorithms.h"
+#include "cmMakefile.h"
+#include "cmake.h"
+
+class cmExecutionStatus;
+class cmTarget;
 
 bool cmTargetCompileFeaturesCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 9 - 0
Source/cmTargetCompileFeaturesCommand.h

@@ -3,7 +3,16 @@
 #ifndef cmTargetCompileFeaturesCommand_h
 #define cmTargetCompileFeaturesCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmTargetPropCommandBase.h"
+#include "cmTypeMacro.h"
+
+class cmCommand;
+class cmExecutionStatus;
+class cmTarget;
 
 class cmTargetCompileFeaturesCommand : public cmTargetPropCommandBase
 {

+ 9 - 0
Source/cmTargetCompileOptionsCommand.cxx

@@ -2,7 +2,16 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmTargetCompileOptionsCommand.h"
 
+#include <algorithm>
+#include <sstream>
+
 #include "cmAlgorithms.h"
+#include "cmListFileCache.h"
+#include "cmMakefile.h"
+#include "cmTarget.h"
+#include "cmake.h"
+
+class cmExecutionStatus;
 
 bool cmTargetCompileOptionsCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 9 - 0
Source/cmTargetCompileOptionsCommand.h

@@ -3,7 +3,16 @@
 #ifndef cmTargetCompileOptionsCommand_h
 #define cmTargetCompileOptionsCommand_h
 
+#include <cmConfigure.h>
+#include <string>
+#include <vector>
+
 #include "cmTargetPropCommandBase.h"
+#include "cmTypeMacro.h"
+
+class cmCommand;
+class cmExecutionStatus;
+class cmTarget;
 
 class cmTargetCompileOptionsCommand : public cmTargetPropCommandBase
 {

Some files were not shown because too many files changed in this diff