diff options
author | Brad King <brad.king@kitware.com> | 2016-10-24 10:16:40 -0400 |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-10-24 10:16:40 -0400 |
commit | b899c0a92f6833c4996276d86d9e0fb3d42df77c (patch) | |
tree | 4a21fd3a3ac03ec9d5ae9a9acd9d7f7e0ee1af23 /Source | |
parent | 3d5ec790eea47a91c6f70d172c42839db02b8467 (diff) | |
parent | 569509f4bfbf44c67e237a01f957fdfe52223cfa (diff) | |
download | cmake-b899c0a92f6833c4996276d86d9e0fb3d42df77c.tar.gz |
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
Diffstat (limited to 'Source')
120 files changed, 1092 insertions, 350 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 2b8c17cd7d..09c0acfd18 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,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) diff --git a/Source/cmAddCompileOptionsCommand.cxx b/Source/cmAddCompileOptionsCommand.cxx index 9265cba7c1..21a8012d86 100644 --- a/Source/cmAddCompileOptionsCommand.cxx +++ b/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&) { diff --git a/Source/cmAddCompileOptionsCommand.h b/Source/cmAddCompileOptionsCommand.h index 52c4b51d27..4c715e769c 100644 --- a/Source/cmAddCompileOptionsCommand.h +++ b/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 { diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx index a03d77d83f..3d0729b8e0 100644 --- a/Source/cmAddExecutableCommand.cxx +++ b/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&) diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 0777ef008e..56cf91ae4b 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/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") diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index bb1e2390c3..0ebe35d54b 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/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&) diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index 665591185b..04e1a0b0db 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/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( diff --git a/Source/cmAuxSourceDirectoryCommand.h b/Source/cmAuxSourceDirectoryCommand.h index cca70dc0d3..6c1531955e 100644 --- a/Source/cmAuxSourceDirectoryCommand.h +++ b/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. diff --git a/Source/cmBootstrapCommands1.cxx b/Source/cmBootstrapCommands1.cxx deleted file mode 100644 index 2b3b62fd03..0000000000 --- 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.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); -} diff --git a/Source/cmBootstrapCommands2.cxx b/Source/cmBootstrapCommands2.cxx deleted file mode 100644 index 625c3e0709..0000000000 --- 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.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); -} diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index 816147b246..3257c93915 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/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&) diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h index 7c09d734aa..cefa37941b 100644 --- a/Source/cmBuildNameCommand.h +++ b/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 { diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx index 018010efb5..7da93ace85 100644 --- a/Source/cmCMakeHostSystemInformationCommand.cxx +++ b/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&) diff --git a/Source/cmCMakeHostSystemInformationCommand.h b/Source/cmCMakeHostSystemInformationCommand.h index 4ab6aa1c1e..585d7fac3e 100644 --- a/Source/cmCMakeHostSystemInformationCommand.h +++ b/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 diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx index 80b5108ca0..d71172c860 100644 --- a/Source/cmCMakeMinimumRequired.cxx +++ b/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 diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 155456a9df..b70074e350 100644 --- a/Source/cmCPluginAPI.cxx +++ b/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> diff --git a/Source/cmCommand.cxx b/Source/cmCommand.cxx new file mode 100644 index 0000000000..3c839de859 --- /dev/null +++ b/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; +} diff --git a/Source/cmCommand.h b/Source/cmCommand.h index d8e337dd69..9299c7128b 100644 --- a/Source/cmCommand.h +++ b/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; diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx new file mode 100644 index 0000000000..0697d4b739 --- /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<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; +} diff --git a/Source/cmCommands.cxx.in b/Source/cmCommands.cxx.in deleted file mode 100644 index 9eddf303db..0000000000 --- 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<cmCommand*>& commands) -{ -@NEW_COMMANDS@ -} diff --git a/Source/cmCommands.h b/Source/cmCommands.h index c2a59b8ef4..649dea6b5b 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<cmCommand*>& commands); -void GetBootstrapCommands2(std::vector<cmCommand*>& commands); -void GetPredefinedCommands(std::vector<cmCommand*>& commands); +std::vector<cmCommand*> GetPredefinedCommands(); #endif diff --git a/Source/cmCommandsForBootstrap.cxx b/Source/cmCommandsForBootstrap.cxx deleted file mode 100644 index 1b3bf511d9..0000000000 --- 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<cmCommand*>&) -{ -} diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 4c0b6491a0..7d98e737b7 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/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() && diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index 6a451f5fd3..0755dceb7d 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/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 diff --git a/Source/cmContinueCommand.cxx b/Source/cmContinueCommand.cxx index ce364635cc..dc3e02c99d 100644 --- a/Source/cmContinueCommand.cxx +++ b/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) diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx index ec62c5bc6e..b062d4d9f6 100644 --- a/Source/cmCreateTestSourceList.cxx +++ b/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, diff --git a/Source/cmElseIfCommand.cxx b/Source/cmElseIfCommand.cxx index cc3624b96c..1c322488fa 100644 --- a/Source/cmElseIfCommand.cxx +++ b/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&) { diff --git a/Source/cmElseIfCommand.h b/Source/cmElseIfCommand.h index a489e30b9c..6675b16876 100644 --- a/Source/cmElseIfCommand.h +++ b/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 diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index 4fb599863a..c9dac352d6 100644 --- a/Source/cmExportCommand.cxx +++ b/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) diff --git a/Source/cmExportCommand.h b/Source/cmExportCommand.h index ebde71c010..88930002ac 100644 --- a/Source/cmExportCommand.h +++ b/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 diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index 66b77a6f9d..bf1ea012b6 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/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&) diff --git a/Source/cmExportLibraryDependenciesCommand.h b/Source/cmExportLibraryDependenciesCommand.h index fa9f35333d..0a7823a030 100644 --- a/Source/cmExportLibraryDependenciesCommand.h +++ b/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 { diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index 5f621f15c8..1f0ce8d09c 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/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, diff --git a/Source/cmFLTKWrapUICommand.h b/Source/cmFLTKWrapUICommand.h index 202067f9ce..74bb8bb4e2 100644 --- a/Source/cmFLTKWrapUICommand.h +++ b/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 diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 8dd204b653..6b5870b08a 100644 --- a/Source/cmFileCommand.cxx +++ b/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; diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index ff822b88d7..118c58121b 100644 --- a/Source/cmFindBase.cxx +++ b/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 diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index bd5298dd07..bc175ff2d3 100644 --- a/Source/cmFindCommon.cxx +++ b/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> diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 5d8aaa2a23..56be0cba74 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/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() diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 029d4220b4..373b728be4 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/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; } diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 7d37185154..66dc5d742d 100644 --- a/Source/cmFindPathCommand.cxx +++ b/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() diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 9886860980..d258c3c8d2 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/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__) diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 987741bca4..6fbc93d975 100644 --- a/Source/cmForEachCommand.cxx +++ b/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) diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 99d883aaaa..9da4cf6d21 100644 --- a/Source/cmFunctionCommand.cxx +++ b/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 diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index e5949f086b..01b41e86bf 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -4,6 +4,7 @@ #include "cmAlgorithms.h" #include "cmGlobalGenerator.h" +#include "cmState.h" #include "cmStateTypes.h" #include "cmake.h" diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx index 8ebad4e311..0670d31692 100644 --- a/Source/cmGetDirectoryPropertyCommand.cxx +++ b/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 diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx index e121ecec77..db855d2c9b 100644 --- a/Source/cmHexFileConverter.cxx +++ b/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; } } diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index a2dec55b98..eb85b16165 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -4,6 +4,7 @@ #include "cmOutputConverter.h" #include "cmStringCommand.h" +#include "cmSystemTools.h" #include "cmConditionEvaluator.h" diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index acf51a7f13..e89641f4ee 100644 --- a/Source/cmIncludeCommand.cxx +++ b/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&) diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index f37f1ca183..2260366e21 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/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&) diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx index d598722101..e7e940245e 100644 --- a/Source/cmIncludeExternalMSProjectCommand.cxx +++ b/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&) diff --git a/Source/cmIncludeExternalMSProjectCommand.h b/Source/cmIncludeExternalMSProjectCommand.h index 9401016618..bfe7b2a3ab 100644 --- a/Source/cmIncludeExternalMSProjectCommand.h +++ b/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. diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index d85748e543..476755a4eb 100644 --- a/Source/cmInstallCommand.cxx +++ b/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> diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx index f072ff5bfc..50f97e9ea3 100644 --- a/Source/cmInstallFilesCommand.cxx +++ b/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, diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx index bb2b61fc61..5ee81fbf69 100644 --- a/Source/cmInstallProgramsCommand.cxx +++ b/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&) diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h index cb85cce036..aa6c2fc9b7 100644 --- a/Source/cmInstallProgramsCommand.h +++ b/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 diff --git a/Source/cmInstallTargetsCommand.cxx b/Source/cmInstallTargetsCommand.cxx index fca0bf1bda..07f990dafb 100644 --- a/Source/cmInstallTargetsCommand.cxx +++ b/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&) diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx index fc6bf29a10..3a18a437dd 100644 --- a/Source/cmLinkDirectoriesCommand.cxx +++ b/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&) diff --git a/Source/cmLinkLibrariesCommand.cxx b/Source/cmLinkLibrariesCommand.cxx index 4202cf5d49..708ec8c008 100644 --- a/Source/cmLinkLibrariesCommand.cxx +++ b/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&) diff --git a/Source/cmLinkLibrariesCommand.h b/Source/cmLinkLibrariesCommand.h index b4943b6f87..160eeb4422 100644 --- a/Source/cmLinkLibrariesCommand.h +++ b/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. diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 98f3aa38b9..6cc9590177 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -3,6 +3,7 @@ #include "cmListCommand.h" #include "cmAlgorithms.h" +#include "cmSystemTools.h" #include <cmsys/RegularExpression.hxx> #include <cmsys/SystemTools.hxx> diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 49db5b0456..2a06cb4d7e 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/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, diff --git a/Source/cmLoadCacheCommand.h b/Source/cmLoadCacheCommand.h index 57f64cdcce..64b82c59cf 100644 --- a/Source/cmLoadCacheCommand.h +++ b/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 diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index bcfec797cb..82d2ee3266 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/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; } /** diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h index e42d46ace0..470b9c5658 100644 --- a/Source/cmLoadCommandCommand.h +++ b/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 { diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 9917394a73..cb8bd58458 100644 --- a/Source/cmMacroCommand.cxx +++ b/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 diff --git a/Source/cmMakeDirectoryCommand.cxx b/Source/cmMakeDirectoryCommand.cxx index e0011bdf92..fda9eeaa6a 100644 --- a/Source/cmMakeDirectoryCommand.cxx +++ b/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&) diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index 8f9e288744..7297193a83 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/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&) diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 9a83cd9f63..83d847a1fd 100644 --- a/Source/cmMessageCommand.cxx +++ b/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, diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index 0186ef20c1..d6efa2c23c 100644 --- a/Source/cmOptionCommand.cxx +++ b/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&) diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index 8b629fe1bd..6ecd942b1a 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/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. diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h index 7a81a76158..6bce1b7458 100644 --- a/Source/cmOutputRequiredFilesCommand.h +++ b/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 { diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx index 55d71ea1f7..e45e3a511c 100644 --- a/Source/cmParseArgumentsCommand.cxx +++ b/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) { diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index c27da8e6d9..4188661d59 100644 --- a/Source/cmProjectCommand.cxx +++ b/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&) diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx index 3a721da07d..b0ff68dc4c 100644 --- a/Source/cmQTWrapCPPCommand.cxx +++ b/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&) diff --git a/Source/cmQTWrapCPPCommand.h b/Source/cmQTWrapCPPCommand.h index 3567fb6954..015f90e409 100644 --- a/Source/cmQTWrapCPPCommand.h +++ b/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 diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx index 3b0f0830bf..052e6333ac 100644 --- a/Source/cmQTWrapUICommand.cxx +++ b/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&) diff --git a/Source/cmQTWrapUICommand.h b/Source/cmQTWrapUICommand.h index 84b88a8f80..da439617aa 100644 --- a/Source/cmQTWrapUICommand.h +++ b/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 diff --git a/Source/cmRemoveCommand.cxx b/Source/cmRemoveCommand.cxx index 540f37f613..5a52927654 100644 --- a/Source/cmRemoveCommand.cxx +++ b/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&) diff --git a/Source/cmRemoveCommand.h b/Source/cmRemoveCommand.h index bf33de0a7d..51070381d0 100644 --- a/Source/cmRemoveCommand.h +++ b/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 diff --git a/Source/cmRemoveDefinitionsCommand.cxx b/Source/cmRemoveDefinitionsCommand.cxx index cae50728c9..f5fe2dfb78 100644 --- a/Source/cmRemoveDefinitionsCommand.cxx +++ b/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&) diff --git a/Source/cmRemoveDefinitionsCommand.h b/Source/cmRemoveDefinitionsCommand.h index 016f5fd1c3..c88c66d146 100644 --- a/Source/cmRemoveDefinitionsCommand.h +++ b/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 diff --git a/Source/cmReturnCommand.cxx b/Source/cmReturnCommand.cxx index aa056c338a..f8b31294d5 100644 --- a/Source/cmReturnCommand.cxx +++ b/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) diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index c34028eebb..fd3d4829a4 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -4,6 +4,7 @@ #include "cmAlgorithms.h" #include "cmFindCommon.h" +#include "cmSystemTools.h" cmSearchPath::cmSearchPath(cmFindCommon* findCmd) : FC(findCmd) diff --git a/Source/cmSeparateArgumentsCommand.cxx b/Source/cmSeparateArgumentsCommand.cxx index b5c318674a..77546a3851 100644 --- a/Source/cmSeparateArgumentsCommand.cxx +++ b/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&) diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 65b0e9c4a4..9f59db4a63 100644 --- a/Source/cmSetCommand.cxx +++ b/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&) diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 2a4101f39a..552f9185a0 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/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() { diff --git a/Source/cmSetSourceFilesPropertiesCommand.cxx b/Source/cmSetSourceFilesPropertiesCommand.cxx index 002158986b..6a87d6d5aa 100644 --- a/Source/cmSetSourceFilesPropertiesCommand.cxx +++ b/Source/cmSetSourceFilesPropertiesCommand.cxx @@ -3,6 +3,7 @@ #include "cmSetSourceFilesPropertiesCommand.h" #include "cmSourceFile.h" +#include "cmSystemTools.h" // cmSetSourceFilesPropertiesCommand bool cmSetSourceFilesPropertiesCommand::InitialPass( diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 7664eca310..18c2a3efe0 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/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 diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index 2b176b50a0..ff3ec7f794 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/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&) diff --git a/Source/cmSourceGroupCommand.h b/Source/cmSourceGroupCommand.h index e3639df614..89d86dcb9b 100644 --- a/Source/cmSourceGroupCommand.h +++ b/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. diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index c73025a975..33d22e4539 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -3,6 +3,7 @@ #include "cmStringCommand.h" #include "cmCryptoHash.h" +#include "cmSystemTools.h" #include <cmsys/RegularExpression.hxx> #include <cmsys/SystemTools.hxx> diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx index fe7f659778..d502c5f324 100644 --- a/Source/cmSubdirCommand.cxx +++ b/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&) diff --git a/Source/cmSubdirDependsCommand.cxx b/Source/cmSubdirDependsCommand.cxx index b5b4148c76..9259836778 100644 --- a/Source/cmSubdirDependsCommand.cxx +++ b/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&) { diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h index 0f3deb671d..c8d9025ace 100644 --- a/Source/cmSubdirDependsCommand.h +++ b/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 { diff --git a/Source/cmTargetCompileDefinitionsCommand.cxx b/Source/cmTargetCompileDefinitionsCommand.cxx index 9f08ba76fc..008d1a210a 100644 --- a/Source/cmTargetCompileDefinitionsCommand.cxx +++ b/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&) diff --git a/Source/cmTargetCompileDefinitionsCommand.h b/Source/cmTargetCompileDefinitionsCommand.h index b49f6162da..69edfb2121 100644 --- a/Source/cmTargetCompileDefinitionsCommand.h +++ b/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 { diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx index 7636347306..a1c9b824df 100644 --- a/Source/cmTargetCompileFeaturesCommand.cxx +++ b/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&) diff --git a/Source/cmTargetCompileFeaturesCommand.h b/Source/cmTargetCompileFeaturesCommand.h index 8273e025e7..275df439ad 100644 --- a/Source/cmTargetCompileFeaturesCommand.h +++ b/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 { diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx index eb66dd3083..a4db55b41b 100644 --- a/Source/cmTargetCompileOptionsCommand.cxx +++ b/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&) diff --git a/Source/cmTargetCompileOptionsCommand.h b/Source/cmTargetCompileOptionsCommand.h index f5b4c706c6..d1a9d5b155 100644 --- a/Source/cmTargetCompileOptionsCommand.h +++ b/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 { diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx index 37b9598a28..65a31490fc 100644 --- a/Source/cmTargetIncludeDirectoriesCommand.cxx +++ b/Source/cmTargetIncludeDirectoriesCommand.cxx @@ -2,7 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetIncludeDirectoriesCommand.h" +#include <set> +#include <sstream> + #include "cmGeneratorExpression.h" +#include "cmListFileCache.h" +#include "cmMakefile.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmake.h" + +class cmExecutionStatus; bool cmTargetIncludeDirectoriesCommand::InitialPass( std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h index 671627a561..e206823b65 100644 --- a/Source/cmTargetIncludeDirectoriesCommand.h +++ b/Source/cmTargetIncludeDirectoriesCommand.h @@ -3,7 +3,16 @@ #ifndef cmTargetIncludeDirectoriesCommand_h #define cmTargetIncludeDirectoriesCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmTargetPropCommandBase.h" +#include "cmTypeMacro.h" + +class cmCommand; +class cmExecutionStatus; +class cmTarget; class cmTargetIncludeDirectoriesCommand : public cmTargetPropCommandBase { diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 804dc5a08c..962699274e 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -3,6 +3,9 @@ #include "cmTargetLinkLibrariesCommand.h" #include "cmGeneratorExpression.h" +#include "cmGlobalGenerator.h" +#include "cmState.h" +#include "cmSystemTools.h" const char* cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[3] = { "general", "debug", "optimized" diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx index 2170247154..13c9a8f783 100644 --- a/Source/cmTargetSourcesCommand.cxx +++ b/Source/cmTargetSourcesCommand.cxx @@ -2,7 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetSourcesCommand.h" -#include "cmGeneratorExpression.h" +#include <algorithm> +#include <sstream> + +#include "cmAlgorithms.h" +#include "cmMakefile.h" +#include "cmTarget.h" +#include "cmake.h" + +class cmExecutionStatus; bool cmTargetSourcesCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmTargetSourcesCommand.h b/Source/cmTargetSourcesCommand.h index 8f88b25f8c..fa5738a036 100644 --- a/Source/cmTargetSourcesCommand.h +++ b/Source/cmTargetSourcesCommand.h @@ -3,7 +3,16 @@ #ifndef cmTargetSourcesCommand_h #define cmTargetSourcesCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmTargetPropCommandBase.h" +#include "cmTypeMacro.h" + +class cmCommand; +class cmExecutionStatus; +class cmTarget; class cmTargetSourcesCommand : public cmTargetPropCommandBase { diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index 6a8c9c60a6..9597e093a4 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTimestamp.h" +#include "cmSystemTools.h" + #include <cstdlib> #include <cstring> #include <sstream> diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index b248489762..6787c8e38a 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -2,7 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTryRunCommand.h" +#include "cmState.h" +#include "cmSystemTools.h" #include "cmTryCompileCommand.h" + #include <cmsys/FStream.hxx> // cmTryRunCommand diff --git a/Source/cmUnsetCommand.cxx b/Source/cmUnsetCommand.cxx index 746c435913..2fea619256 100644 --- a/Source/cmUnsetCommand.cxx +++ b/Source/cmUnsetCommand.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmUnsetCommand.h" +#include "cmSystemTools.h" + // cmUnsetCommand bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx index e2b6b1aea7..ffeaa5167d 100644 --- a/Source/cmUseMangledMesaCommand.cxx +++ b/Source/cmUseMangledMesaCommand.cxx @@ -2,11 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmUseMangledMesaCommand.h" -#include "cmSystemTools.h" - #include <cmsys/FStream.hxx> #include <cmsys/RegularExpression.hxx> +#include "cmPolicies.h" +#include "cmSystemTools.h" + +class cmExecutionStatus; + bool cmUseMangledMesaCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) { diff --git a/Source/cmUseMangledMesaCommand.h b/Source/cmUseMangledMesaCommand.h index a5fa146f58..bf6352c79a 100644 --- a/Source/cmUseMangledMesaCommand.h +++ b/Source/cmUseMangledMesaCommand.h @@ -3,7 +3,14 @@ #ifndef cmUseMangledMesaCommand_h #define cmUseMangledMesaCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +#include "cmTypeMacro.h" + +class cmExecutionStatus; class cmUseMangledMesaCommand : public cmCommand { diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index c816114042..f98d512cd6 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -2,7 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmUtilitySourceCommand.h" +#include <string.h> + +#include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmState.h" #include "cmState.h" +#include "cmSystemTools.h" + +class cmExecutionStatus; // cmUtilitySourceCommand bool cmUtilitySourceCommand::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h index 6ee5f3ead8..7d123136f2 100644 --- a/Source/cmUtilitySourceCommand.h +++ b/Source/cmUtilitySourceCommand.h @@ -3,7 +3,14 @@ #ifndef cmUtilitySourceCommand_h #define cmUtilitySourceCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +#include "cmTypeMacro.h" + +class cmExecutionStatus; class cmUtilitySourceCommand : public cmCommand { diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index 75995517ca..1eb1f20ca4 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -2,7 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmVariableRequiresCommand.h" +#include "cmMakefile.h" +#include "cmPolicies.h" #include "cmState.h" +#include "cmSystemTools.h" + +class cmExecutionStatus; // cmLibraryCommand bool cmVariableRequiresCommand::InitialPass( diff --git a/Source/cmVariableRequiresCommand.h b/Source/cmVariableRequiresCommand.h index e40151b30b..62f89da661 100644 --- a/Source/cmVariableRequiresCommand.h +++ b/Source/cmVariableRequiresCommand.h @@ -3,7 +3,14 @@ #ifndef cmVariableRequiresCommand_h #define cmVariableRequiresCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +#include "cmTypeMacro.h" + +class cmExecutionStatus; class cmVariableRequiresCommand : public cmCommand { diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx index 5c1e00a19c..90b0b28646 100644 --- a/Source/cmVariableWatchCommand.cxx +++ b/Source/cmVariableWatchCommand.cxx @@ -2,7 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmVariableWatchCommand.h" +#include <sstream> + +#include "cmExecutionStatus.h" +#include "cmListFileCache.h" +#include "cmMakefile.h" +#include "cmSystemTools.h" #include "cmVariableWatch.h" +#include "cmake.h" struct cmVariableWatchCallbackData { diff --git a/Source/cmVariableWatchCommand.h b/Source/cmVariableWatchCommand.h index b1862f0235..5f5cba85aa 100644 --- a/Source/cmVariableWatchCommand.h +++ b/Source/cmVariableWatchCommand.h @@ -3,7 +3,15 @@ #ifndef cmVariableWatchCommand_h #define cmVariableWatchCommand_h +#include <cmConfigure.h> +#include <set> +#include <string> +#include <vector> + #include "cmCommand.h" +#include "cmTypeMacro.h" + +class cmExecutionStatus; /** \class cmVariableWatchCommand * \brief Watch when the variable changes and invoke command diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index c52ea403b0..beb59bfbda 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -3,6 +3,7 @@ #include "cmWhileCommand.h" #include "cmConditionEvaluator.h" +#include "cmSystemTools.h" cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf) : Makefile(mf) diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx index 0bdef0fffc..b3ac31c7a4 100644 --- a/Source/cmWriteFileCommand.cxx +++ b/Source/cmWriteFileCommand.cxx @@ -8,6 +8,11 @@ // include sys/stat.h after sys/types.h #include <sys/stat.h> +#include "cmMakefile.h" +#include "cmSystemTools.h" + +class cmExecutionStatus; + // cmLibraryCommand bool cmWriteFileCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmWriteFileCommand.h b/Source/cmWriteFileCommand.h index dbadf841cd..c6a30b080e 100644 --- a/Source/cmWriteFileCommand.h +++ b/Source/cmWriteFileCommand.h @@ -3,7 +3,14 @@ #ifndef cmWriteFileCommand_h #define cmWriteFileCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +#include "cmTypeMacro.h" + +class cmExecutionStatus; /** \class cmWriteFileCommand * \brief Writes a message to a file diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 44b76ef46d..eb76ca0309 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1649,11 +1649,8 @@ const char* cmake::GetCacheDefinition(const std::string& name) const void cmake::AddDefaultCommands() { - std::vector<cmCommand*> commands; - GetBootstrapCommands1(commands); - GetBootstrapCommands2(commands); - GetPredefinedCommands(commands); - for (std::vector<cmCommand*>::iterator i = commands.begin(); + std::vector<cmCommand*> const commands = GetPredefinedCommands(); + for (std::vector<cmCommand*>::const_iterator i = commands.begin(); i != commands.end(); ++i) { this->State->AddCommand(*i); } |