summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-10-19 08:54:18 +0200
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-10-21 18:14:50 +0200
commitf69e768d94ff5e0238cbb924836737c4ce11a930 (patch)
tree88d4d5f0725b81517779456a6a2c9dd9136a5297 /Source
parent1e555a44aa4e3d40bca2f88915c9f957098e5a55 (diff)
downloadcmake-f69e768d94ff5e0238cbb924836737c4ce11a930.tar.gz
Separate compilation for commands included in cmCommands
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt15
-rw-r--r--Source/cmAddCompileOptionsCommand.cxx4
-rw-r--r--Source/cmAddCompileOptionsCommand.h7
-rw-r--r--Source/cmAuxSourceDirectoryCommand.cxx10
-rw-r--r--Source/cmAuxSourceDirectoryCommand.h7
-rw-r--r--Source/cmBuildNameCommand.cxx8
-rw-r--r--Source/cmBuildNameCommand.h7
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.cxx7
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.h11
-rw-r--r--Source/cmCPluginAPI.cxx6
-rw-r--r--Source/cmElseIfCommand.cxx2
-rw-r--r--Source/cmElseIfCommand.h9
-rw-r--r--Source/cmExportCommand.cxx18
-rw-r--r--Source/cmExportCommand.h8
-rw-r--r--Source/cmExportLibraryDependenciesCommand.cxx12
-rw-r--r--Source/cmExportLibraryDependenciesCommand.h7
-rw-r--r--Source/cmFLTKWrapUICommand.cxx8
-rw-r--r--Source/cmFLTKWrapUICommand.h8
-rw-r--r--Source/cmIncludeExternalMSProjectCommand.cxx6
-rw-r--r--Source/cmIncludeExternalMSProjectCommand.h7
-rw-r--r--Source/cmInstallProgramsCommand.cxx8
-rw-r--r--Source/cmInstallProgramsCommand.h7
-rw-r--r--Source/cmLinkLibrariesCommand.cxx4
-rw-r--r--Source/cmLinkLibrariesCommand.h7
-rw-r--r--Source/cmLoadCacheCommand.cxx8
-rw-r--r--Source/cmLoadCacheCommand.h8
-rw-r--r--Source/cmLoadCommandCommand.cxx11
-rw-r--r--Source/cmLoadCommandCommand.h7
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx12
-rw-r--r--Source/cmOutputRequiredFilesCommand.h8
-rw-r--r--Source/cmQTWrapCPPCommand.cxx7
-rw-r--r--Source/cmQTWrapCPPCommand.h7
-rw-r--r--Source/cmQTWrapUICommand.cxx7
-rw-r--r--Source/cmQTWrapUICommand.h7
-rw-r--r--Source/cmRemoveCommand.cxx5
-rw-r--r--Source/cmRemoveCommand.h7
-rw-r--r--Source/cmRemoveDefinitionsCommand.cxx4
-rw-r--r--Source/cmRemoveDefinitionsCommand.h7
-rw-r--r--Source/cmSourceGroupCommand.cxx8
-rw-r--r--Source/cmSourceGroupCommand.h7
-rw-r--r--Source/cmSubdirDependsCommand.cxx4
-rw-r--r--Source/cmSubdirDependsCommand.h7
-rw-r--r--Source/cmTargetCompileDefinitionsCommand.cxx7
-rw-r--r--Source/cmTargetCompileDefinitionsCommand.h9
-rw-r--r--Source/cmTargetCompileFeaturesCommand.cxx8
-rw-r--r--Source/cmTargetCompileFeaturesCommand.h9
-rw-r--r--Source/cmTargetCompileOptionsCommand.cxx9
-rw-r--r--Source/cmTargetCompileOptionsCommand.h9
-rw-r--r--Source/cmTargetIncludeDirectoriesCommand.cxx10
-rw-r--r--Source/cmTargetIncludeDirectoriesCommand.h9
-rw-r--r--Source/cmTargetSourcesCommand.cxx10
-rw-r--r--Source/cmTargetSourcesCommand.h9
-rw-r--r--Source/cmUseMangledMesaCommand.cxx7
-rw-r--r--Source/cmUseMangledMesaCommand.h7
-rw-r--r--Source/cmUtilitySourceCommand.cxx8
-rw-r--r--Source/cmUtilitySourceCommand.h7
-rw-r--r--Source/cmVariableRequiresCommand.cxx5
-rw-r--r--Source/cmVariableRequiresCommand.h7
-rw-r--r--Source/cmVariableWatchCommand.cxx7
-rw-r--r--Source/cmVariableWatchCommand.h8
-rw-r--r--Source/cmWriteFileCommand.cxx5
-rw-r--r--Source/cmWriteFileCommand.h7
62 files changed, 449 insertions, 32 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 2b8c17cd7d..9f8a3e2080 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -401,9 +401,8 @@ 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(COMMAND_INCLUDES "#include \"cmTargetPropCommandBase.h\"\n")
+list(APPEND SRCS cmTargetPropCommandBase.cxx cmTargetPropCommandBase.h)
set(NEW_COMMANDS "")
foreach(command_file
cmAddCompileOptionsCommand
@@ -418,6 +417,7 @@ foreach(command_file
cmInstallProgramsCommand
cmLinkLibrariesCommand
cmLoadCacheCommand
+ cmLoadCommandCommand
cmOutputRequiredFilesCommand
cmQTWrapCPPCommand
cmQTWrapUICommand
@@ -435,15 +435,10 @@ foreach(command_file
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(COMMAND_INCLUDES "${COMMAND_INCLUDES}#include \"${command_file}.h\"\n")
set(NEW_COMMANDS "${NEW_COMMANDS}commands.push_back(new ${command_file});\n")
- list(APPEND SRCS ${command_file}.cxx)
- set_property(SOURCE ${command_file}.cxx PROPERTY HEADER_FILE_ONLY ON)
+ list(APPEND SRCS ${command_file}.cxx ${command_file}.h)
endforeach()
configure_file(cmCommands.cxx.in ${CMAKE_CURRENT_BINARY_DIR}/cmCommands.cxx @ONLY)
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/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/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/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/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/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/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/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/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..12b3aa8131 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
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/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/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/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/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/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/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/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