From 4fb70919a57582e4ca7c2a9f6bc4f72b38f9af86 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Wed, 19 Oct 2016 23:17:10 +0200 Subject: Create all commands from a single function --- Source/CMakeLists.txt | 109 ++++++++++------- Source/cmBootstrapCommands1.cxx | 87 -------------- Source/cmBootstrapCommands2.cxx | 94 --------------- Source/cmCommands.cxx | 238 ++++++++++++++++++++++++++++++++++++++ Source/cmCommands.cxx.in | 10 -- Source/cmCommands.h | 10 +- Source/cmCommandsForBootstrap.cxx | 7 -- Source/cmake.cxx | 7 +- bootstrap | 4 +- 9 files changed, 308 insertions(+), 258 deletions(-) delete mode 100644 Source/cmBootstrapCommands1.cxx delete mode 100644 Source/cmBootstrapCommands2.cxx create mode 100644 Source/cmCommands.cxx delete mode 100644 Source/cmCommands.cxx.in delete mode 100644 Source/cmCommandsForBootstrap.cxx diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 5c8636e..b2617ae 100644 --- a/Source/CMakeLists.txt +++ b/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,10 @@ set(SRCS cmake.cxx cmake.h + cmCommands.cxx + cmCommands.h + cmAddCompileOptionsCommand.cxx + cmAddCompileOptionsCommand.h cmAddCustomCommandCommand.cxx cmAddCustomCommandCommand.h cmAddCustomTargetCommand.cxx @@ -406,10 +406,16 @@ set(SRCS 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 @@ -430,6 +436,8 @@ set(SRCS cmDefinePropertyCommand.h cmElseCommand.cxx cmElseCommand.h + cmElseIfCommand.cxx + cmElseIfCommand.h cmEnableLanguageCommand.cxx cmEnableLanguageCommand.h cmEnableTestingCommand.cxx @@ -450,6 +458,12 @@ set(SRCS cmExecuteProcessCommand.h cmExpandedCommandArgument.cxx cmExpandedCommandArgument.h + cmExportCommand.cxx + cmExportCommand.h + cmExportLibraryDependenciesCommand.cxx + cmExportLibraryDependenciesCommand.h + cmFLTKWrapUICommand.cxx + cmFLTKWrapUICommand.h cmFileCommand.cxx cmFileCommand.h cmFindBase.cxx @@ -492,6 +506,8 @@ set(SRCS cmIncludeCommand.h cmIncludeDirectoryCommand.cxx cmIncludeDirectoryCommand.h + cmIncludeExternalMSProjectCommand.cxx + cmIncludeExternalMSProjectCommand.h cmIncludeRegularExpressionCommand.cxx cmIncludeRegularExpressionCommand.h cmInstallCommand.cxx @@ -500,12 +516,20 @@ set(SRCS 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 @@ -518,12 +542,22 @@ set(SRCS 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 @@ -544,12 +578,28 @@ set(SRCS 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 @@ -558,8 +608,18 @@ set(SRCS 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 @@ -572,47 +632,6 @@ set(SRCS cm_codecvt.cxx ) -set(COMMAND_INCLUDES "#include \"cmTargetPropCommandBase.h\"\n") -list(APPEND SRCS cmTargetPropCommandBase.cxx cmTargetPropCommandBase.h) -set(NEW_COMMANDS "") -foreach(command_file - cmAddCompileOptionsCommand - cmAuxSourceDirectoryCommand - cmBuildNameCommand - cmCMakeHostSystemInformationCommand - cmElseIfCommand - cmExportCommand - cmExportLibraryDependenciesCommand - cmFLTKWrapUICommand - cmIncludeExternalMSProjectCommand - cmInstallProgramsCommand - cmLinkLibrariesCommand - cmLoadCacheCommand - cmLoadCommandCommand - cmOutputRequiredFilesCommand - cmQTWrapCPPCommand - cmQTWrapUICommand - cmRemoveCommand - cmRemoveDefinitionsCommand - cmSourceGroupCommand - cmSubdirDependsCommand - cmTargetCompileDefinitionsCommand - cmTargetCompileFeaturesCommand - cmTargetCompileOptionsCommand - cmTargetIncludeDirectoriesCommand - cmTargetSourcesCommand - cmUseMangledMesaCommand - cmUtilitySourceCommand - cmVariableRequiresCommand - cmVariableWatchCommand - cmWriteFileCommand - ) - set(COMMAND_INCLUDES "${COMMAND_INCLUDES}#include \"${command_file}.h\"\n") - set(NEW_COMMANDS "${NEW_COMMANDS}commands.push_back(new ${command_file});\n") - list(APPEND SRCS ${command_file}.cxx ${command_file}.h) -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) diff --git a/Source/cmBootstrapCommands1.cxx b/Source/cmBootstrapCommands1.cxx deleted file mode 100644 index afb7ad8..0000000 --- a/Source/cmBootstrapCommands1.cxx +++ /dev/null @@ -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.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 "cmCommands.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 "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 "cmParseArgumentsCommand.h" -#include "cmPathLabel.h" -#include "cmSearchPath.h" - -void GetBootstrapCommands1(std::vector& 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); -} diff --git a/Source/cmBootstrapCommands2.cxx b/Source/cmBootstrapCommands2.cxx deleted file mode 100644 index 972d5b3..0000000 --- a/Source/cmBootstrapCommands2.cxx +++ /dev/null @@ -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.h" -#include "cmExpandedCommandArgument.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 "cmProjectCommand.h" -#include "cmReturnCommand.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" - -void GetBootstrapCommands2(std::vector& 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); -} diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx new file mode 100644 index 0000000..0697d4b --- /dev/null +++ b/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 GetPredefinedCommands() +{ + std::vector 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; +} diff --git a/Source/cmCommands.cxx.in b/Source/cmCommands.cxx.in deleted file mode 100644 index 9eddf30..0000000 --- a/Source/cmCommands.cxx.in +++ /dev/null @@ -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& commands) -{ -@NEW_COMMANDS@ -} diff --git a/Source/cmCommands.h b/Source/cmCommands.h index c2a59b8..649dea6 100644 --- a/Source/cmCommands.h +++ b/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& commands); -void GetBootstrapCommands2(std::vector& commands); -void GetPredefinedCommands(std::vector& commands); +std::vector GetPredefinedCommands(); #endif diff --git a/Source/cmCommandsForBootstrap.cxx b/Source/cmCommandsForBootstrap.cxx deleted file mode 100644 index 1b3bf51..0000000 --- a/Source/cmCommandsForBootstrap.cxx +++ /dev/null @@ -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&) -{ -} diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 388984f..210ac41 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1652,11 +1652,8 @@ const char* cmake::GetCacheDefinition(const std::string& name) const void cmake::AddDefaultCommands() { - std::vector commands; - GetBootstrapCommands1(commands); - GetBootstrapCommands2(commands); - GetPredefinedCommands(commands); - for (std::vector::iterator i = commands.begin(); + std::vector const commands = GetPredefinedCommands(); + for (std::vector::const_iterator i = commands.begin(); i != commands.end(); ++i) { this->State->AddCommand(*i); } diff --git a/bootstrap b/bootstrap index 5a0b8df..eb927d5 100755 --- a/bootstrap +++ b/bootstrap @@ -309,9 +309,7 @@ CMAKE_CXX_SOURCES="\ cmOutputConverter \ cmOSXBundleGenerator \ cmNewLineStyle \ - cmBootstrapCommands1 \ - cmBootstrapCommands2 \ - cmCommandsForBootstrap \ + cmCommands \ cmTarget \ cmTargetPropertyComputer \ cmTest \ -- cgit v0.12