From 3f9c4cdf89ce00ae72a1176dbf5e68b5f1f1720e Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Thu, 1 Sep 2016 20:02:57 +0200 Subject: [PATCH 1/5] Tests/CMakeLib: use cmsys::ifstream --- Tests/CMakeLib/run_compile_commands.cxx | 17 ++++++++++------- Tests/CMakeLib/testRST.cxx | 9 ++++++--- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index 502ffe7c2..529c8304c 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -1,6 +1,6 @@ #include "cmSystemTools.h" -#include +#include #include #include #include @@ -26,7 +26,10 @@ public: }; typedef std::vector TranslationUnitsType; - CompileCommandParser(std::ifstream* input) { this->Input = input; } + CompileCommandParser(std::istream& input) + : Input(input) + { + } void Parse() { @@ -109,8 +112,8 @@ private: void Next() { - this->C = char(Input->get()); - if (this->Input->bad()) { + this->C = char(Input.get()); + if (this->Input.bad()) { ErrorExit("Unexpected end of file."); } } @@ -131,13 +134,13 @@ private: TranslationUnitsType TranslationUnits; CommandType Command; std::string String; - std::ifstream* Input; + std::istream& Input; }; int main() { - std::ifstream file("compile_commands.json"); - CompileCommandParser parser(&file); + cmsys::ifstream file("compile_commands.json"); + CompileCommandParser parser(file); parser.Parse(); for (CompileCommandParser::TranslationUnitsType::const_iterator it = parser.GetTranslationUnits().begin(), diff --git a/Tests/CMakeLib/testRST.cxx b/Tests/CMakeLib/testRST.cxx index e5a96c22c..cc9269390 100644 --- a/Tests/CMakeLib/testRST.cxx +++ b/Tests/CMakeLib/testRST.cxx @@ -10,9 +10,12 @@ See the License for more information. ============================================================================*/ #include "cmRST.h" - #include "cmSystemTools.h" +#include +#include +#include + void reportLine(std::ostream& os, bool ret, std::string const& line, bool eol) { if (ret) { @@ -52,8 +55,8 @@ int testRST(int argc, char* argv[]) } // Compare expected and actual outputs. - std::ifstream e_fin(e_name.c_str()); - std::ifstream a_fin(a_name.c_str()); + cmsys::ifstream e_fin(e_name.c_str()); + cmsys::ifstream a_fin(a_name.c_str()); if (!e_fin) { std::cerr << "Could not open input " << e_name << std::endl; return 1; From 54140848181e15acfda9c385e6cdc5c8b4f2a1d6 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Thu, 1 Sep 2016 20:04:35 +0200 Subject: [PATCH 2/5] Tests/CMakeLib: include what you use --- Tests/CMakeLib/testGeneratedFileStream.cxx | 3 +++ Tests/CMakeLib/testUTF8.cxx | 2 -- Tests/CMakeLib/testXMLSafe.cxx | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Tests/CMakeLib/testGeneratedFileStream.cxx b/Tests/CMakeLib/testGeneratedFileStream.cxx index e5a2f4d98..a31cc4208 100644 --- a/Tests/CMakeLib/testGeneratedFileStream.cxx +++ b/Tests/CMakeLib/testGeneratedFileStream.cxx @@ -12,6 +12,9 @@ #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" +#include +#include + #define cmFailed(m1, m2) \ std::cout << "FAILED: " << m1 << m2 << "\n"; \ failed = 1 diff --git a/Tests/CMakeLib/testUTF8.cxx b/Tests/CMakeLib/testUTF8.cxx index 019a2ddb9..c99a92524 100644 --- a/Tests/CMakeLib/testUTF8.cxx +++ b/Tests/CMakeLib/testUTF8.cxx @@ -10,9 +10,7 @@ See the License for more information. ============================================================================*/ #include - #include -#include typedef char test_utf8_char[5]; diff --git a/Tests/CMakeLib/testXMLSafe.cxx b/Tests/CMakeLib/testXMLSafe.cxx index 4970ccc50..356880c11 100644 --- a/Tests/CMakeLib/testXMLSafe.cxx +++ b/Tests/CMakeLib/testXMLSafe.cxx @@ -9,9 +9,11 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include +#include "cmXMLSafe.h" -#include "cmStandardIncludes.h" +#include +#include +#include struct test_pair { From 3838a0d5fbed480c007b1667eddf2d6797a24344 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Thu, 1 Sep 2016 20:05:48 +0200 Subject: [PATCH 3/5] make sure to include cmConfigure.h before cmStandardIncludes.h --- Source/CPack/WiX/cmWIXRichTextFormatWriter.h | 2 ++ Source/CPack/cmCPackComponentGroup.h | 2 ++ Source/CursesDialog/cmCursesStandardIncludes.h | 2 ++ Source/bindexplib.h | 2 ++ Source/cmAlgorithms.h | 2 ++ Source/cmCTest.h | 2 ++ Source/cmCallVisualStudioMacro.h | 2 ++ Source/cmCommandArgumentParserHelper.h | 2 ++ Source/cmCommandArgumentsHelper.h | 2 ++ Source/cmConfigure.cmake.h.in | 2 +- Source/cmCryptoHash.h | 2 ++ Source/cmCurl.h | 2 ++ Source/cmCustomCommand.h | 2 ++ Source/cmCustomCommandGenerator.h | 2 ++ Source/cmDefinitions.h | 2 ++ Source/cmDepends.h | 2 ++ Source/cmDependsJavaLexer.cxx | 2 ++ Source/cmDependsJavaParserHelper.h | 2 ++ Source/cmDocumentation.h | 2 ++ Source/cmDocumentationFormatter.h | 2 ++ Source/cmDynamicLoader.h | 2 ++ Source/cmExecutionStatus.h | 2 ++ Source/cmExpandedCommandArgument.h | 2 ++ Source/cmExprLexer.cxx | 2 ++ Source/cmExprParserHelper.h | 2 ++ Source/cmExternalMakefileProjectGenerator.h | 2 ++ Source/cmFileLock.h | 2 ++ Source/cmFileLockPool.h | 2 ++ Source/cmFileLockResult.h | 2 ++ Source/cmFilePathUuid.h | 2 ++ Source/cmFileTimeComparison.h | 2 ++ Source/cmFortranParser.h | 2 ++ Source/cmFunctionBlocker.h | 2 ++ Source/cmGeneratedFileStream.h | 2 ++ Source/cmGeneratorExpression.h | 2 ++ Source/cmGeneratorExpressionDAGChecker.h | 2 ++ Source/cmGeneratorExpressionLexer.h | 2 ++ Source/cmGhsMultiGpj.h | 2 ++ Source/cmGlobalGenerator.h | 2 ++ Source/cmGlobalGeneratorFactory.h | 4 ++++ Source/cmGraphAdjacencyList.h | 2 ++ Source/cmGraphVizWriter.h | 2 ++ Source/cmHexFileConverter.h | 2 ++ Source/cmIDEOptions.h | 2 ++ Source/cmInstallCommandArguments.h | 2 ++ Source/cmLinkedTree.h | 2 ++ Source/cmListFileCache.h | 2 ++ Source/cmLocalGenerator.h | 2 ++ Source/cmLocale.h | 2 ++ Source/cmNinjaTypes.h | 2 ++ Source/cmOSXBundleGenerator.h | 2 ++ Source/cmObject.h | 2 ++ Source/cmOrderDirectories.h | 2 ++ Source/cmOutputConverter.h | 2 ++ Source/cmPathLabel.h | 2 ++ Source/cmQtAutoGeneratorInitializer.h | 2 ++ Source/cmQtAutoGenerators.h | 2 ++ Source/cmRST.h | 2 ++ Source/cmScriptGenerator.h | 2 ++ Source/cmSearchPath.h | 2 ++ Source/cmSourceFileLocation.h | 2 ++ Source/cmSourceGroup.h | 2 ++ Source/cmTargetDepend.h | 2 ++ Source/cmTargetExport.h | 2 ++ Source/cmTimestamp.h | 2 ++ Source/cmVisualStudio10TargetGenerator.h | 2 ++ Source/cmVisualStudioSlnData.h | 2 ++ Source/cmVisualStudioSlnParser.h | 2 ++ Source/cmVisualStudioWCEPlatformParser.h | 2 ++ Source/cmXCodeObject.h | 2 ++ Source/cmake.h | 2 ++ Source/cmcmd.h | 2 ++ 72 files changed, 145 insertions(+), 1 deletion(-) diff --git a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h index acf1fa6f4..63a2ec0ad 100644 --- a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h +++ b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h @@ -13,6 +13,8 @@ #ifndef cmWIXRichTextFormatWriter_h #define cmWIXRichTextFormatWriter_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/CPack/cmCPackComponentGroup.h b/Source/CPack/cmCPackComponentGroup.h index 01a9e76f5..78b81b350 100644 --- a/Source/CPack/cmCPackComponentGroup.h +++ b/Source/CPack/cmCPackComponentGroup.h @@ -13,6 +13,8 @@ #ifndef cmCPackComponentGroup_h #define cmCPackComponentGroup_h +#include + #include "cmStandardIncludes.h" class cmCPackComponentGroup; diff --git a/Source/CursesDialog/cmCursesStandardIncludes.h b/Source/CursesDialog/cmCursesStandardIncludes.h index 7b44df9cf..095397869 100644 --- a/Source/CursesDialog/cmCursesStandardIncludes.h +++ b/Source/CursesDialog/cmCursesStandardIncludes.h @@ -12,6 +12,8 @@ #ifndef cmCursesStandardIncludes_h #define cmCursesStandardIncludes_h +#include + #include "../cmStandardIncludes.h" #if defined(__sun__) && defined(__GNUC__) diff --git a/Source/bindexplib.h b/Source/bindexplib.h index 8661a4aab..715808a53 100644 --- a/Source/bindexplib.h +++ b/Source/bindexplib.h @@ -13,6 +13,8 @@ #ifndef bindexplib_h #define bindexplib_h +#include + #include "cmStandardIncludes.h" diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index ee803c8e8..a6c71d297 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -12,6 +12,8 @@ #ifndef cmAlgorithms_h #define cmAlgorithms_h +#include + #include "cmStandardIncludes.h" inline bool cmHasLiteralPrefixImpl(const std::string& str1, const char* str2, diff --git a/Source/cmCTest.h b/Source/cmCTest.h index b6657c95f..20f5caf18 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -13,6 +13,8 @@ #ifndef cmCTest_h #define cmCTest_h +#include + #include "cmStandardIncludes.h" #include "cmListFileCache.h" diff --git a/Source/cmCallVisualStudioMacro.h b/Source/cmCallVisualStudioMacro.h index e516fe268..fd735cf49 100644 --- a/Source/cmCallVisualStudioMacro.h +++ b/Source/cmCallVisualStudioMacro.h @@ -12,6 +12,8 @@ #ifndef cmCallVisualStudioMacro_h #define cmCallVisualStudioMacro_h +#include + #include "cmStandardIncludes.h" /** \class cmCallVisualStudioMacro diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h index 97b706c32..1040ad3b8 100644 --- a/Source/cmCommandArgumentParserHelper.h +++ b/Source/cmCommandArgumentParserHelper.h @@ -12,6 +12,8 @@ #ifndef cmCommandArgumentParserHelper_h #define cmCommandArgumentParserHelper_h +#include + #include "cmStandardIncludes.h" #define YYSTYPE cmCommandArgumentParserHelper::ParserType diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h index 913314881..19a6f8de4 100644 --- a/Source/cmCommandArgumentsHelper.h +++ b/Source/cmCommandArgumentsHelper.h @@ -12,6 +12,8 @@ #ifndef cmCommandArgumentsHelper_h #define cmCommandArgumentsHelper_h +#include + #include "cmStandardIncludes.h" class cmCommandArgumentsHelper; diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index cb671ddea..ccea22d68 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -12,7 +12,7 @@ #ifndef cmConfigure_h #define cmConfigure_h -#include +#include // IWYU pragma: keep #ifdef _MSC_VER #pragma warning(disable : 4786) diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h index 4e92b063e..c51393d8b 100644 --- a/Source/cmCryptoHash.h +++ b/Source/cmCryptoHash.h @@ -12,6 +12,8 @@ #ifndef cmCryptoHash_h #define cmCryptoHash_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmCurl.h b/Source/cmCurl.h index 26bf94e09..c3a20533d 100644 --- a/Source/cmCurl.h +++ b/Source/cmCurl.h @@ -12,6 +12,8 @@ #ifndef cmCurl_h #define cmCurl_h +#include + #include "cmStandardIncludes.h" #include "cm_curl.h" diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h index 34753f405..152b3b904 100644 --- a/Source/cmCustomCommand.h +++ b/Source/cmCustomCommand.h @@ -12,6 +12,8 @@ #ifndef cmCustomCommand_h #define cmCustomCommand_h +#include + #include "cmStandardIncludes.h" #include "cmListFileCache.h" diff --git a/Source/cmCustomCommandGenerator.h b/Source/cmCustomCommandGenerator.h index a361153ae..66644d6f0 100644 --- a/Source/cmCustomCommandGenerator.h +++ b/Source/cmCustomCommandGenerator.h @@ -12,6 +12,8 @@ #ifndef cmCustomCommandGenerator_h #define cmCustomCommandGenerator_h +#include + #include "cmStandardIncludes.h" class cmCustomCommand; diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index 8f1813c98..f22de7957 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -12,6 +12,8 @@ #ifndef cmDefinitions_h #define cmDefinitions_h +#include + #include "cmStandardIncludes.h" #include "cmLinkedTree.h" diff --git a/Source/cmDepends.h b/Source/cmDepends.h index 0e1cbb925..b9d47a67f 100644 --- a/Source/cmDepends.h +++ b/Source/cmDepends.h @@ -12,6 +12,8 @@ #ifndef cmDepends_h #define cmDepends_h +#include + #include "cmStandardIncludes.h" class cmFileTimeComparison; diff --git a/Source/cmDependsJavaLexer.cxx b/Source/cmDependsJavaLexer.cxx index f7676d9c2..5d644cef5 100644 --- a/Source/cmDependsJavaLexer.cxx +++ b/Source/cmDependsJavaLexer.cxx @@ -1,3 +1,5 @@ +#include + #include "cmStandardIncludes.h" #line 2 "cmDependsJavaLexer.cxx" diff --git a/Source/cmDependsJavaParserHelper.h b/Source/cmDependsJavaParserHelper.h index 6ff024563..377d5846c 100644 --- a/Source/cmDependsJavaParserHelper.h +++ b/Source/cmDependsJavaParserHelper.h @@ -12,6 +12,8 @@ #ifndef cmDependsJavaParserHelper_h #define cmDependsJavaParserHelper_h +#include + #include "cmStandardIncludes.h" #define YYSTYPE cmDependsJavaParserHelper::ParserType diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index ac36c8b0a..c82e1d466 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -12,6 +12,8 @@ #ifndef _cmDocumentation_h #define _cmDocumentation_h +#include + #include "cmStandardIncludes.h" #include "cmDocumentationFormatter.h" diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h index 7c4c35bd8..7a931206b 100644 --- a/Source/cmDocumentationFormatter.h +++ b/Source/cmDocumentationFormatter.h @@ -12,6 +12,8 @@ #ifndef _cmDocumentationFormatter_h #define _cmDocumentationFormatter_h +#include + #include "cmStandardIncludes.h" /** This is just a helper class to make it build with MSVC 6.0. diff --git a/Source/cmDynamicLoader.h b/Source/cmDynamicLoader.h index 58d9ae9fc..d9b89905f 100644 --- a/Source/cmDynamicLoader.h +++ b/Source/cmDynamicLoader.h @@ -17,6 +17,8 @@ #ifndef cmDynamicLoader_h #define cmDynamicLoader_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h index 800651407..14e14543b 100644 --- a/Source/cmExecutionStatus.h +++ b/Source/cmExecutionStatus.h @@ -12,6 +12,8 @@ #ifndef cmExecutionStatus_h #define cmExecutionStatus_h +#include + #include "cmStandardIncludes.h" /** \class cmExecutionStatus diff --git a/Source/cmExpandedCommandArgument.h b/Source/cmExpandedCommandArgument.h index 1f8e40547..fa0eaa9bb 100644 --- a/Source/cmExpandedCommandArgument.h +++ b/Source/cmExpandedCommandArgument.h @@ -12,6 +12,8 @@ #ifndef cmExpandedCommandArgument_h #define cmExpandedCommandArgument_h +#include + #include "cmStandardIncludes.h" /** \class cmExpandedCommandArgument diff --git a/Source/cmExprLexer.cxx b/Source/cmExprLexer.cxx index 4704f0368..b16ec1aa9 100644 --- a/Source/cmExprLexer.cxx +++ b/Source/cmExprLexer.cxx @@ -1,3 +1,5 @@ +#include + #include "cmStandardIncludes.h" #line 2 "/home/andy/vtk/CMake-bin/Source/cmExprLexer.cxx" diff --git a/Source/cmExprParserHelper.h b/Source/cmExprParserHelper.h index af0b9164a..8e3d9964c 100644 --- a/Source/cmExprParserHelper.h +++ b/Source/cmExprParserHelper.h @@ -12,6 +12,8 @@ #ifndef cmExprParserHelper_h #define cmExprParserHelper_h +#include + #include "cmStandardIncludes.h" #define YYSTYPE cmExprParserHelper::ParserType diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h index 6ae553323..7d10ce1a5 100644 --- a/Source/cmExternalMakefileProjectGenerator.h +++ b/Source/cmExternalMakefileProjectGenerator.h @@ -12,6 +12,8 @@ #ifndef cmExternalMakefileProjectGenerator_h #define cmExternalMakefileProjectGenerator_h +#include + #include "cmStandardIncludes.h" #include "cmDocumentation.h" diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h index 538b7162e..38b90e1bf 100644 --- a/Source/cmFileLock.h +++ b/Source/cmFileLock.h @@ -13,6 +13,8 @@ #ifndef cmFileLock_h #define cmFileLock_h +#include + #include "cmStandardIncludes.h" #if defined(_WIN32) diff --git a/Source/cmFileLockPool.h b/Source/cmFileLockPool.h index dc42e6ff3..a3883dab4 100644 --- a/Source/cmFileLockPool.h +++ b/Source/cmFileLockPool.h @@ -12,6 +12,8 @@ #ifndef cmFileLockPool_h #define cmFileLockPool_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmFileLockResult.h b/Source/cmFileLockResult.h index d5ac354f2..10d4c13fd 100644 --- a/Source/cmFileLockResult.h +++ b/Source/cmFileLockResult.h @@ -13,6 +13,8 @@ #ifndef cmFileLockResult_h #define cmFileLockResult_h +#include + #include "cmStandardIncludes.h" #if defined(_WIN32) diff --git a/Source/cmFilePathUuid.h b/Source/cmFilePathUuid.h index 42e89b106..619c71b7d 100644 --- a/Source/cmFilePathUuid.h +++ b/Source/cmFilePathUuid.h @@ -13,6 +13,8 @@ #ifndef cmFilePathUuid_h #define cmFilePathUuid_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmFileTimeComparison.h b/Source/cmFileTimeComparison.h index 409bd64f2..52e974ccc 100644 --- a/Source/cmFileTimeComparison.h +++ b/Source/cmFileTimeComparison.h @@ -12,6 +12,8 @@ #ifndef cmFileTimeComparison_h #define cmFileTimeComparison_h +#include + #include "cmStandardIncludes.h" class cmFileTimeComparisonInternal; diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h index 07e1b1c1c..5f1c7acdf 100644 --- a/Source/cmFortranParser.h +++ b/Source/cmFortranParser.h @@ -13,6 +13,8 @@ #define cmFortranParser_h #if !defined(cmFortranLexer_cxx) && !defined(cmFortranParser_cxx) +#include + #include "cmStandardIncludes.h" #endif diff --git a/Source/cmFunctionBlocker.h b/Source/cmFunctionBlocker.h index c7e3b713a..4a600e7fb 100644 --- a/Source/cmFunctionBlocker.h +++ b/Source/cmFunctionBlocker.h @@ -12,6 +12,8 @@ #ifndef cmFunctionBlocker_h #define cmFunctionBlocker_h +#include + #include "cmStandardIncludes.h" #include "cmExecutionStatus.h" diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h index 3480c5bca..e5e3320d0 100644 --- a/Source/cmGeneratedFileStream.h +++ b/Source/cmGeneratedFileStream.h @@ -12,6 +12,8 @@ #ifndef cmGeneratedFileStream_h #define cmGeneratedFileStream_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 2f9160873..75e69b4bc 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -13,6 +13,8 @@ #ifndef cmGeneratorExpression_h #define cmGeneratorExpression_h +#include + #include "cmStandardIncludes.h" #include "cmListFileCache.h" diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h index 6b7fe9ae5..e522728f2 100644 --- a/Source/cmGeneratorExpressionDAGChecker.h +++ b/Source/cmGeneratorExpressionDAGChecker.h @@ -12,6 +12,8 @@ #ifndef cmGeneratorExpressionDAGChecker_h #define cmGeneratorExpressionDAGChecker_h +#include + #include "cmStandardIncludes.h" #include "cmGeneratorExpressionEvaluator.h" diff --git a/Source/cmGeneratorExpressionLexer.h b/Source/cmGeneratorExpressionLexer.h index 72ad7315b..6bd336bce 100644 --- a/Source/cmGeneratorExpressionLexer.h +++ b/Source/cmGeneratorExpressionLexer.h @@ -12,6 +12,8 @@ #ifndef cmGeneratorExpressionLexer_h #define cmGeneratorExpressionLexer_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmGhsMultiGpj.h b/Source/cmGhsMultiGpj.h index b388455a1..4d8a757d4 100644 --- a/Source/cmGhsMultiGpj.h +++ b/Source/cmGhsMultiGpj.h @@ -12,6 +12,8 @@ #ifndef cmGhsMultiGpj_h #define cmGhsMultiGpj_h +#include + #include "cmStandardIncludes.h" class cmGeneratedFileStream; diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 089a63701..dc80a33e4 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -13,6 +13,8 @@ #ifndef cmGlobalGenerator_h #define cmGlobalGenerator_h +#include + #include "cmStandardIncludes.h" #include "cmExportSetMap.h" // For cmExportSetMap diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h index 74d314538..26bc2c0d5 100644 --- a/Source/cmGlobalGeneratorFactory.h +++ b/Source/cmGlobalGeneratorFactory.h @@ -13,6 +13,10 @@ #ifndef cmGlobalGeneratorFactory_h #define cmGlobalGeneratorFactory_h +#include + +#include + #include "cmStandardIncludes.h" class cmake; diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h index 5666d48f1..65bed5e82 100644 --- a/Source/cmGraphAdjacencyList.h +++ b/Source/cmGraphAdjacencyList.h @@ -12,6 +12,8 @@ #ifndef cmGraphAdjacencyList_h #define cmGraphAdjacencyList_h +#include + #include "cmStandardIncludes.h" /** diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h index c73d82d09..06437854f 100644 --- a/Source/cmGraphVizWriter.h +++ b/Source/cmGraphVizWriter.h @@ -12,6 +12,8 @@ #ifndef CMGRAPHVIZWRITER_H #define CMGRAPHVIZWRITER_H +#include + #include "cmStandardIncludes.h" #include "cmGeneratedFileStream.h" diff --git a/Source/cmHexFileConverter.h b/Source/cmHexFileConverter.h index 56fa9b1b8..06616a284 100644 --- a/Source/cmHexFileConverter.h +++ b/Source/cmHexFileConverter.h @@ -12,6 +12,8 @@ #ifndef cmHexFileConverter_h #define cmHexFileConverter_h +#include + #include "cmStandardIncludes.h" /** \class cmHexFileConverter diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h index fac7d4e82..df0f82e9b 100644 --- a/Source/cmIDEOptions.h +++ b/Source/cmIDEOptions.h @@ -12,6 +12,8 @@ #ifndef cmIDEOptions_h #define cmIDEOptions_h +#include + #include "cmStandardIncludes.h" #include "cmIDEFlagTable.h" diff --git a/Source/cmInstallCommandArguments.h b/Source/cmInstallCommandArguments.h index 6ccb3e868..2ef421fd7 100644 --- a/Source/cmInstallCommandArguments.h +++ b/Source/cmInstallCommandArguments.h @@ -13,6 +13,8 @@ #ifndef cmInstallCommandArguments_h #define cmInstallCommandArguments_h +#include + #include "cmStandardIncludes.h" #include "cmCommandArgumentsHelper.h" diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index 6b3107444..466aaa7d7 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -12,6 +12,8 @@ #ifndef cmLinkedTree_h #define cmLinkedTree_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index cd4453680..08b59ebd5 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -12,6 +12,8 @@ #ifndef cmListFileCache_h #define cmListFileCache_h +#include + #include "cmStandardIncludes.h" #include "cmState.h" diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index fa4bb3065..f7a4074f3 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -12,6 +12,8 @@ #ifndef cmLocalGenerator_h #define cmLocalGenerator_h +#include + #include "cmStandardIncludes.h" #include "cmOutputConverter.h" diff --git a/Source/cmLocale.h b/Source/cmLocale.h index f922c0341..f9bc45827 100644 --- a/Source/cmLocale.h +++ b/Source/cmLocale.h @@ -12,6 +12,8 @@ #ifndef cmLocale_h #define cmLocale_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmNinjaTypes.h b/Source/cmNinjaTypes.h index 82a52202f..d3816bb44 100644 --- a/Source/cmNinjaTypes.h +++ b/Source/cmNinjaTypes.h @@ -13,6 +13,8 @@ #ifndef cmNinjaTypes_h #define cmNinjaTypes_h +#include + #include "cmStandardIncludes.h" typedef std::vector cmNinjaDeps; diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h index 55a3c756f..2dc1e4a44 100644 --- a/Source/cmOSXBundleGenerator.h +++ b/Source/cmOSXBundleGenerator.h @@ -12,6 +12,8 @@ #ifndef cmOSXBundleGenerator_h #define cmOSXBundleGenerator_h +#include + #include "cmStandardIncludes.h" #include "cmSourceFile.h" diff --git a/Source/cmObject.h b/Source/cmObject.h index d883c5216..cb683f685 100644 --- a/Source/cmObject.h +++ b/Source/cmObject.h @@ -12,6 +12,8 @@ #ifndef cmObject_h #define cmObject_h +#include + #include "cmStandardIncludes.h" /** \class cmObject diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h index 38e197c95..13823a18b 100644 --- a/Source/cmOrderDirectories.h +++ b/Source/cmOrderDirectories.h @@ -12,6 +12,8 @@ #ifndef cmOrderDirectories_h #define cmOrderDirectories_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index 9af96590e..02468c83a 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -12,6 +12,8 @@ #ifndef cmOutputConverter_h #define cmOutputConverter_h +#include + #include "cmStandardIncludes.h" #include "cmGlobalGenerator.h" diff --git a/Source/cmPathLabel.h b/Source/cmPathLabel.h index 39fbec3d4..e06511093 100644 --- a/Source/cmPathLabel.h +++ b/Source/cmPathLabel.h @@ -12,6 +12,8 @@ #ifndef cmPathLabel_h #define cmPathLabel_h +#include + #include "cmStandardIncludes.h" /** \class cmPathLabel diff --git a/Source/cmQtAutoGeneratorInitializer.h b/Source/cmQtAutoGeneratorInitializer.h index b411597f7..c5a7aba72 100644 --- a/Source/cmQtAutoGeneratorInitializer.h +++ b/Source/cmQtAutoGeneratorInitializer.h @@ -14,6 +14,8 @@ #ifndef cmQtAutoGeneratorInitializer_h #define cmQtAutoGeneratorInitializer_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index fab2d1934..ba439d462 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -14,6 +14,8 @@ #ifndef cmQtAutoGenerators_h #define cmQtAutoGenerators_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmRST.h b/Source/cmRST.h index 0e379b60d..895901a7c 100644 --- a/Source/cmRST.h +++ b/Source/cmRST.h @@ -12,6 +12,8 @@ #ifndef _cmRST_h #define _cmRST_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h index ef0766f6d..4f4dd9ed6 100644 --- a/Source/cmScriptGenerator.h +++ b/Source/cmScriptGenerator.h @@ -12,6 +12,8 @@ #ifndef cmScriptGenerator_h #define cmScriptGenerator_h +#include + #include "cmStandardIncludes.h" class cmScriptGeneratorIndent diff --git a/Source/cmSearchPath.h b/Source/cmSearchPath.h index 65f703fe7..7624d03f5 100644 --- a/Source/cmSearchPath.h +++ b/Source/cmSearchPath.h @@ -12,6 +12,8 @@ #ifndef cmSearchPath_h #define cmSearchPath_h +#include + #include "cmStandardIncludes.h" class cmFindCommon; diff --git a/Source/cmSourceFileLocation.h b/Source/cmSourceFileLocation.h index 79891732f..d41f2bdfb 100644 --- a/Source/cmSourceFileLocation.h +++ b/Source/cmSourceFileLocation.h @@ -12,6 +12,8 @@ #ifndef cmSourceFileLocation_h #define cmSourceFileLocation_h +#include + #include "cmStandardIncludes.h" class cmMakefile; diff --git a/Source/cmSourceGroup.h b/Source/cmSourceGroup.h index 1f5232e60..c7f093f20 100644 --- a/Source/cmSourceGroup.h +++ b/Source/cmSourceGroup.h @@ -12,6 +12,8 @@ #ifndef cmSourceGroup_h #define cmSourceGroup_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h index 954d8f622..f30705dfd 100644 --- a/Source/cmTargetDepend.h +++ b/Source/cmTargetDepend.h @@ -12,6 +12,8 @@ #ifndef cmTargetDepend_h #define cmTargetDepend_h +#include + #include "cmStandardIncludes.h" class cmGeneratorTarget; diff --git a/Source/cmTargetExport.h b/Source/cmTargetExport.h index 2781337fe..b3882c432 100644 --- a/Source/cmTargetExport.h +++ b/Source/cmTargetExport.h @@ -12,6 +12,8 @@ #ifndef cmTargetExport_h #define cmTargetExport_h +#include + #include "cmStandardIncludes.h" class cmGeneratorTarget; diff --git a/Source/cmTimestamp.h b/Source/cmTimestamp.h index 77e1f7ac1..3a72caaaa 100644 --- a/Source/cmTimestamp.h +++ b/Source/cmTimestamp.h @@ -12,6 +12,8 @@ #ifndef cmTimestamp_h #define cmTimestamp_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 109a10040..72a70dfeb 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -12,6 +12,8 @@ #ifndef cmVisualStudioTargetGenerator_h #define cmVisualStudioTargetGenerator_h +#include + #include "cmStandardIncludes.h" class cmMakefile; diff --git a/Source/cmVisualStudioSlnData.h b/Source/cmVisualStudioSlnData.h index 450837071..982b97632 100644 --- a/Source/cmVisualStudioSlnData.h +++ b/Source/cmVisualStudioSlnData.h @@ -12,6 +12,8 @@ #ifndef cmVisualStudioSlnData_h #define cmVisualStudioSlnData_h +#include + #include "cmStandardIncludes.h" class cmSlnProjectEntry diff --git a/Source/cmVisualStudioSlnParser.h b/Source/cmVisualStudioSlnParser.h index b9f8a9248..62fd93699 100644 --- a/Source/cmVisualStudioSlnParser.h +++ b/Source/cmVisualStudioSlnParser.h @@ -12,6 +12,8 @@ #ifndef cmVisualStudioSlnParser_h #define cmVisualStudioSlnParser_h +#include + #include "cmStandardIncludes.h" #include diff --git a/Source/cmVisualStudioWCEPlatformParser.h b/Source/cmVisualStudioWCEPlatformParser.h index 2b20eba93..ca58a9af1 100644 --- a/Source/cmVisualStudioWCEPlatformParser.h +++ b/Source/cmVisualStudioWCEPlatformParser.h @@ -12,6 +12,8 @@ #ifndef cmVisualStudioWCEPlatformParser_h #define cmVisualStudioWCEPlatformParser_h +#include + #include "cmStandardIncludes.h" #include "cmXMLParser.h" diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h index ed917aff4..a0aa2b773 100644 --- a/Source/cmXCodeObject.h +++ b/Source/cmXCodeObject.h @@ -12,6 +12,8 @@ #ifndef cmXCodeObject_h #define cmXCodeObject_h +#include + #include "cmStandardIncludes.h" class cmGeneratorTarget; diff --git a/Source/cmake.h b/Source/cmake.h index dbe936ba4..91a23cdaf 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -13,6 +13,8 @@ #ifndef cmake_h #define cmake_h +#include + #include "cmStandardIncludes.h" #include "cmCacheManager.h" diff --git a/Source/cmcmd.h b/Source/cmcmd.h index 8da210345..1096d0ce6 100644 --- a/Source/cmcmd.h +++ b/Source/cmcmd.h @@ -13,6 +13,8 @@ #ifndef cmcmd_h #define cmcmd_h +#include + #include "cmStandardIncludes.h" class cmcmd From bd3d0eafbb362fbc0f140c228da85791a473e44e Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Thu, 1 Sep 2016 20:19:50 +0200 Subject: [PATCH 4/5] cmCTest: don't redefine cout and cerr The definitions have been introduced to ensure that cout and cerr are not used in certain files. However, this limitation does not apply to all source files that require cmCTest.h to be included. Furthermore, the definitions cause side effects depending on the include order. In total, the definitions do more harm than good. Remove them. --- Source/cmCTest.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 20f5caf18..9d661d45e 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -45,16 +45,6 @@ class cmXMLWriter; cmCTestLog_msg.str().c_str(), suppress); \ } while (0) -#ifdef cerr -#undef cerr -#endif -#define cerr no_cerr_use_cmCTestLog - -#ifdef cout -#undef cout -#endif -#define cout no_cout_use_cmCTestLog - /** \class cmCTest * \brief Represents a ctest invocation. * From efed6468eda950644014ccfada85300710e05009 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Thu, 1 Sep 2016 20:59:28 +0200 Subject: [PATCH 5/5] fix a load of include-what-you-use violations --- Source/QtDialog/CMakeSetup.cxx | 2 + Source/cmCTest.cxx | 58 ++++++------- Source/cmCTest.h | 16 ++-- Source/cmCommandArgumentParserHelper.cxx | 14 +++- Source/cmCommandArgumentParserHelper.h | 5 +- Source/cmConditionEvaluator.cxx | 1 + Source/cmCryptoHash.cxx | 2 + Source/cmCryptoHash.h | 4 +- Source/cmCurl.cxx | 9 +- Source/cmCurl.h | 5 +- Source/cmCustomCommand.cxx | 2 +- Source/cmCustomCommand.h | 10 ++- Source/cmCustomCommandGenerator.cxx | 7 ++ Source/cmCustomCommandGenerator.h | 7 +- Source/cmDefinitions.cxx | 2 + Source/cmDefinitions.h | 9 +- Source/cmDepends.cxx | 3 + Source/cmDepends.h | 7 +- Source/cmDependsC.cxx | 5 +- Source/cmDependsC.h | 9 ++ Source/cmDependsFortran.cxx | 8 +- Source/cmDependsFortran.h | 7 ++ Source/cmDependsJava.cxx | 1 - Source/cmDependsJava.h | 7 ++ Source/cmDependsJavaParserHelper.cxx | 7 ++ Source/cmDependsJavaParserHelper.h | 5 +- Source/cmDocumentation.cxx | 9 +- Source/cmDocumentation.h | 14 ++-- Source/cmDocumentationFormatter.cxx | 6 ++ Source/cmDocumentationFormatter.h | 4 +- Source/cmDocumentationSection.h | 7 +- Source/cmDynamicLoader.cxx | 7 ++ Source/cmDynamicLoader.h | 4 +- Source/cmELF.cxx | 8 +- Source/cmELF.h | 5 ++ Source/cmExportBuildFileGenerator.cxx | 14 ++++ Source/cmExportBuildFileGenerator.h | 10 ++- Source/cmExportFileGenerator.cxx | 13 ++- Source/cmExportFileGenerator.h | 14 +++- Source/cmExportInstallFileGenerator.cxx | 10 +++ Source/cmExportInstallFileGenerator.h | 10 +++ Source/cmExportSet.h | 7 +- Source/cmExportSetMap.cxx | 2 + Source/cmExportSetMap.h | 5 +- Source/cmExportTryCompileFileGenerator.cxx | 11 ++- Source/cmExportTryCompileFileGenerator.h | 12 ++- Source/cmExprParserHelper.cxx | 6 +- Source/cmExprParserHelper.h | 8 +- Source/cmExternalMakefileProjectGenerator.cxx | 2 +- Source/cmExternalMakefileProjectGenerator.h | 8 +- Source/cmExtraCodeBlocksGenerator.cxx | 13 ++- Source/cmExtraCodeBlocksGenerator.h | 7 +- Source/cmExtraCodeLiteGenerator.cxx | 16 ++-- Source/cmExtraCodeLiteGenerator.h | 6 ++ Source/cmExtraEclipseCDT4Generator.cxx | 21 +++-- Source/cmExtraEclipseCDT4Generator.h | 10 ++- Source/cmExtraKateGenerator.cxx | 12 ++- Source/cmExtraKateGenerator.h | 6 +- Source/cmExtraSublimeTextGenerator.cxx | 11 ++- Source/cmExtraSublimeTextGenerator.h | 14 +++- Source/cmFileLock.h | 4 +- Source/cmFileLockPool.h | 7 +- Source/cmFileLockResult.cxx | 1 + Source/cmFileLockResult.h | 4 +- Source/cmFilePathUuid.cxx | 2 + Source/cmFilePathUuid.h | 5 +- Source/cmFileTimeComparison.cxx | 13 +-- Source/cmFileTimeComparison.h | 4 +- Source/cmFortranParserImpl.cxx | 9 +- Source/cmGeneratedFileStream.cxx | 2 + Source/cmGeneratedFileStream.h | 3 +- Source/cmGeneratorExpression.cxx | 8 +- Source/cmGeneratorExpression.h | 20 ++--- Source/cmGeneratorExpressionContext.cxx | 2 - Source/cmGeneratorExpressionDAGChecker.cxx | 8 ++ Source/cmGeneratorExpressionDAGChecker.h | 9 +- .../cmGeneratorExpressionEvaluationFile.cxx | 9 +- Source/cmGeneratorExpressionEvaluationFile.h | 5 ++ Source/cmGeneratorExpressionEvaluator.cxx | 17 +--- Source/cmGeneratorExpressionEvaluator.h | 6 +- Source/cmGeneratorExpressionLexer.h | 6 +- Source/cmGeneratorExpressionNode.cxx | 38 +++++++-- Source/cmGeneratorExpressionNode.h | 20 ++--- Source/cmGeneratorExpressionParser.cxx | 3 +- Source/cmGeneratorExpressionParser.h | 5 +- Source/cmGeneratorTarget.cxx | 20 ++++- Source/cmGeneratorTarget.h | 15 +++- Source/cmGhsMultiTargetGenerator.cxx | 1 + Source/cmGlobalCommonGenerator.cxx | 2 + Source/cmGlobalCommonGenerator.h | 4 + Source/cmGlobalGenerator.cxx | 20 +++-- Source/cmGlobalGenerator.h | 34 ++++---- Source/cmGlobalGhsMultiGenerator.cxx | 1 + Source/cmGlobalKdevelopGenerator.cxx | 12 ++- Source/cmGlobalKdevelopGenerator.h | 5 ++ Source/cmGlobalNinjaGenerator.cxx | 13 ++- Source/cmGlobalNinjaGenerator.h | 18 +++- Source/cmGlobalUnixMakefileGenerator3.cxx | 12 +++ Source/cmGlobalUnixMakefileGenerator3.h | 18 +++- Source/cmGlobalVisualStudio10Generator.cxx | 1 + Source/cmGlobalVisualStudio71Generator.cxx | 1 + Source/cmGlobalVisualStudio7Generator.cxx | 1 + Source/cmGlobalVisualStudio8Generator.cxx | 1 + Source/cmGlobalWatcomWMakeGenerator.cxx | 4 +- Source/cmGlobalWatcomWMakeGenerator.h | 10 +++ Source/cmGraphVizWriter.cxx | 10 +++ Source/cmGraphVizWriter.h | 12 ++- Source/cmInstallDirectoryGenerator.cxx | 3 + Source/cmInstallDirectoryGenerator.h | 8 ++ Source/cmInstallExportGenerator.cxx | 18 ++-- Source/cmInstallExportGenerator.h | 12 ++- Source/cmInstallFilesGenerator.cxx | 6 +- Source/cmInstallFilesGenerator.h | 9 ++ Source/cmInstallGenerator.cxx | 2 + Source/cmInstallGenerator.h | 6 ++ Source/cmInstallScriptGenerator.cxx | 5 ++ Source/cmInstallScriptGenerator.h | 5 ++ Source/cmInstallTargetGenerator.cxx | 10 ++- Source/cmInstallTargetGenerator.h | 8 ++ Source/cmInstalledFile.cxx | 4 + Source/cmInstalledFile.h | 7 ++ Source/cmListFileCache.cxx | 7 +- Source/cmListFileCache.h | 7 +- Source/cmLocalCommonGenerator.cxx | 5 ++ Source/cmLocalCommonGenerator.h | 11 ++- Source/cmLocalGenerator.cxx | 14 +++- Source/cmLocalGenerator.h | 22 +++-- Source/cmLocalNinjaGenerator.cxx | 9 ++ Source/cmLocalNinjaGenerator.h | 18 +++- Source/cmLocalUnixMakefileGenerator3.cxx | 18 +++- Source/cmLocalUnixMakefileGenerator3.h | 15 +++- Source/cmLocalVisualStudio10Generator.cxx | 2 + Source/cmLocalVisualStudioGenerator.cxx | 1 + Source/cmLocalXCodeGenerator.cxx | 1 + Source/cmMakefile.cxx | 13 +-- Source/cmMakefile.h | 4 + Source/cmMessenger.cxx | 8 +- Source/cmMessenger.h | 7 +- Source/cmOSXBundleGenerator.cxx | 6 ++ Source/cmOSXBundleGenerator.h | 13 ++- Source/cmOrderDirectories.cxx | 6 +- Source/cmOrderDirectories.h | 10 ++- Source/cmOutputConverter.cxx | 8 +- Source/cmOutputConverter.h | 8 +- Source/cmQtAutoGeneratorInitializer.cxx | 29 ++++++- Source/cmQtAutoGeneratorInitializer.h | 9 +- Source/cmQtAutoGenerators.cxx | 13 ++- Source/cmQtAutoGenerators.h | 5 +- Source/cmRST.cxx | 5 ++ Source/cmRST.h | 9 +- Source/cmScriptGenerator.cxx | 2 + Source/cmScriptGenerator.h | 6 +- Source/cmSourceFile.cxx | 5 ++ Source/cmSourceFile.h | 10 ++- Source/cmSourceFileLocation.cxx | 7 +- Source/cmSourceFileLocation.h | 4 +- Source/cmSourceGroup.h | 6 +- Source/cmSystemTools.cxx | 84 ++++++++++--------- Source/cmTestGenerator.cxx | 1 + Source/cmake.cxx | 41 +++++---- Source/cmake.h | 20 ++--- Source/cmakemain.cxx | 13 ++- Source/cmcmd.cxx | 26 ++++-- Source/cmcmd.h | 5 +- Source/ctest.cxx | 17 ++-- 165 files changed, 1123 insertions(+), 459 deletions(-) diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index ee3389cae..5a8a5bea2 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -27,6 +27,8 @@ #include #include +#include "cmSystemTools.h" // IWYU pragma: keep + static const char* cmDocumentationName[][2] = { { 0, " cmake-gui - CMake GUI." }, { 0, 0 } }; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index b4ddc3e8d..6523e3e15 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -9,52 +9,54 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "cmCurl.h" // include before anything that includes windows.h - #include "cmCTest.h" #include "cmAlgorithms.h" -#include "cmCTestCommand.h" +#include "cmCTestBuildAndTestHandler.h" +#include "cmCTestBuildHandler.h" +#include "cmCTestConfigureHandler.h" +#include "cmCTestCoverageHandler.h" +#include "cmCTestGenericHandler.h" +#include "cmCTestMemCheckHandler.h" +#include "cmCTestScriptHandler.h" #include "cmCTestStartCommand.h" +#include "cmCTestSubmitHandler.h" +#include "cmCTestTestHandler.h" +#include "cmCTestUpdateHandler.h" +#include "cmCTestUploadHandler.h" +#include "cmCurl.h" #include "cmDynamicLoader.h" #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" -#include "cmVersionMacros.h" +#include "cmSystemTools.h" +#include "cmVersion.h" +#include "cmVersionConfig.h" #include "cmXMLWriter.h" #include "cmake.h" + +#include +#include +#include #include #include #include -#include - -#include "cmCTestBuildAndTestHandler.h" -#include "cmCTestBuildHandler.h" -#include "cmCTestConfigureHandler.h" -#include "cmCTestCoverageHandler.h" -#include "cmCTestMemCheckHandler.h" -#include "cmCTestScriptHandler.h" -#include "cmCTestSubmitHandler.h" -#include "cmCTestTestHandler.h" -#include "cmCTestUpdateHandler.h" -#include "cmCTestUploadHandler.h" - -#include "cmVersion.h" - #include #include -#include - +#include +#include #include -#include -#include +#include +#include +#include +#include #include - -#include - -#include -#include +#include +#include +#include +#include +#include #if defined(__BEOS__) || defined(__HAIKU__) #include /* disable_debugger() API. */ diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 9d661d45e..a73cd83b5 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -15,18 +15,18 @@ #include -#include "cmStandardIncludes.h" - -#include "cmListFileCache.h" +#include +#include +#include +#include +#include #include +#include -class cmake; -class cmMakefile; class cmCTestGenericHandler; -class cmGeneratedFileStream; -class cmCTestCommand; -class cmCTestScriptHandler; class cmCTestStartCommand; +class cmGeneratedFileStream; +class cmMakefile; class cmXMLWriter; #define cmCTestLog(ctSelf, logType, msg) \ diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 68111a004..6a2dfe8f6 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -11,12 +11,18 @@ ============================================================================*/ #include "cmCommandArgumentParserHelper.h" -#include "cmMakefile.h" -#include "cmOutputConverter.h" -#include "cmState.h" -#include "cmSystemTools.h" +#include #include "cmCommandArgumentLexer.h" +#include "cmMakefile.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cmake.h" + +#include +#include +#include +#include int cmCommandArgument_yyparse(yyscan_t yyscanner); // diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h index 1040ad3b8..6faf12bc9 100644 --- a/Source/cmCommandArgumentParserHelper.h +++ b/Source/cmCommandArgumentParserHelper.h @@ -12,9 +12,10 @@ #ifndef cmCommandArgumentParserHelper_h #define cmCommandArgumentParserHelper_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include +#include #define YYSTYPE cmCommandArgumentParserHelper::ParserType #define YYSTYPE_IS_DECLARED diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index d7532b37a..94f03e851 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -14,6 +14,7 @@ #include "cmAlgorithms.h" #include "cmOutputConverter.h" +#include "cmSystemTools.h" static std::string const keyAND = "AND"; static std::string const keyCOMMAND = "COMMAND"; diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx index 8e2d87e36..a3d3dd52c 100644 --- a/Source/cmCryptoHash.cxx +++ b/Source/cmCryptoHash.cxx @@ -12,8 +12,10 @@ #include "cmCryptoHash.h" #include "cm_sha2.h" + #include #include +#include CM_AUTO_PTR cmCryptoHash::New(const char* algo) { diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h index c51393d8b..0be2918ee 100644 --- a/Source/cmCryptoHash.h +++ b/Source/cmCryptoHash.h @@ -14,9 +14,9 @@ #include -#include "cmStandardIncludes.h" - #include +#include +#include /** * @brief Abstract base class for cryptographic hash generators diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx index 5bc4f9181..eec773fdb 100644 --- a/Source/cmCurl.cxx +++ b/Source/cmCurl.cxx @@ -11,7 +11,13 @@ ============================================================================*/ #include "cmCurl.h" +#include "cmThirdParty.h" + +#if !defined(CMAKE_USE_SYSTEM_CURL) && !defined(_WIN32) && \ + !defined(__APPLE__) && !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH) +#define CMAKE_FIND_CAFILE #include "cmSystemTools.h" +#endif // curl versions before 7.21.5 did not provide this error code #if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM < 0x071505 @@ -32,8 +38,7 @@ std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile) ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile); check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); } -#if !defined(CMAKE_USE_SYSTEM_CURL) && !defined(_WIN32) && \ - !defined(__APPLE__) && !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH) +#ifdef CMAKE_FIND_CAFILE #define CMAKE_CAFILE_FEDORA "/etc/pki/tls/certs/ca-bundle.crt" else if (cmSystemTools::FileExists(CMAKE_CAFILE_FEDORA, true)) { ::CURLcode res = diff --git a/Source/cmCurl.h b/Source/cmCurl.h index c3a20533d..6434f501a 100644 --- a/Source/cmCurl.h +++ b/Source/cmCurl.h @@ -14,9 +14,8 @@ #include -#include "cmStandardIncludes.h" - -#include "cm_curl.h" +#include +#include std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile = CM_NULLPTR); diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx index eaa49b04d..89a04d147 100644 --- a/Source/cmCustomCommand.cxx +++ b/Source/cmCustomCommand.cxx @@ -13,7 +13,7 @@ #include "cmMakefile.h" -#include +#include cmCustomCommand::cmCustomCommand() : Backtrace() diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h index 152b3b904..b855bb9a1 100644 --- a/Source/cmCustomCommand.h +++ b/Source/cmCustomCommand.h @@ -12,11 +12,15 @@ #ifndef cmCustomCommand_h #define cmCustomCommand_h -#include - -#include "cmStandardIncludes.h" +#include // IWYU pragma: keep +#include "cmCustomCommandLines.h" #include "cmListFileCache.h" + +#include +#include +#include + class cmMakefile; /** \class cmCustomCommand diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 6165bcf11..8b8579b61 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -12,10 +12,17 @@ #include "cmCustomCommandGenerator.h" #include "cmCustomCommand.h" +#include "cmCustomCommandLines.h" #include "cmGeneratorExpression.h" +#include "cmGeneratorTarget.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmOutputConverter.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" + +#include cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc, const std::string& config, diff --git a/Source/cmCustomCommandGenerator.h b/Source/cmCustomCommandGenerator.h index 66644d6f0..f4cd9fda8 100644 --- a/Source/cmCustomCommandGenerator.h +++ b/Source/cmCustomCommandGenerator.h @@ -12,13 +12,14 @@ #ifndef cmCustomCommandGenerator_h #define cmCustomCommandGenerator_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include +#include class cmCustomCommand; -class cmLocalGenerator; class cmGeneratorExpression; +class cmLocalGenerator; class cmCustomCommandGenerator { diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index e0fb59b7d..fecc4887c 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -12,6 +12,8 @@ #include "cmDefinitions.h" #include +#include +#include cmDefinitions::Def cmDefinitions::NoDef; diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index f22de7957..d1423ec76 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -14,20 +14,21 @@ #include -#include "cmStandardIncludes.h" - #include "cmLinkedTree.h" +#include +#include + #if defined(CMAKE_BUILD_WITH_CMAKE) #ifdef CMake_HAVE_CXX_UNORDERED_MAP #include #else #include "cmsys/hash_map.hxx" #endif +#else +#include #endif -#include - /** \class cmDefinitions * \brief Store a scope of variable definitions for CMake language. * diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index ce72eda03..23ff3a478 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -16,8 +16,11 @@ #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmSystemTools.h" + #include +#include #include +#include cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir) : CompileDirectory() diff --git a/Source/cmDepends.h b/Source/cmDepends.h index b9d47a67f..5ed784db5 100644 --- a/Source/cmDepends.h +++ b/Source/cmDepends.h @@ -14,7 +14,12 @@ #include -#include "cmStandardIncludes.h" +#include +#include +#include +#include +#include +#include class cmFileTimeComparison; class cmLocalGenerator; diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 928f7ec42..fbbf42f65 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -15,10 +15,11 @@ #include "cmFileTimeComparison.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmOutputConverter.h" #include "cmSystemTools.h" -#include -#include // isspace +#include +#include #define INCLUDE_REGEX_LINE \ "^[ \t]*#[ \t]*(include|import)[ \t]*[<\"]([^\">]+)([\">])" diff --git a/Source/cmDependsC.h b/Source/cmDependsC.h index bde07b745..5606fb307 100644 --- a/Source/cmDependsC.h +++ b/Source/cmDependsC.h @@ -12,10 +12,19 @@ #ifndef cmDependsC_h #define cmDependsC_h +#include + #include "cmDepends.h" #include +#include +#include #include +#include +#include +#include + +class cmLocalGenerator; /** \class cmDependsC * \brief Dependency scanner for C and C++ object files. diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 8c0acce5e..1eece98ad 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -11,14 +11,20 @@ ============================================================================*/ #include "cmDependsFortran.h" +#include "cmFortranParser.h" /* Interface to parser object. */ #include "cmGeneratedFileStream.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmOutputConverter.h" #include "cmSystemTools.h" -#include "cmFortranParser.h" /* Interface to parser object. */ #include #include +#include +#include +#include +#include +#include // TODO: Test compiler for the case of the mod file. Some always // use lower case and some always use upper case. I do not know if any diff --git a/Source/cmDependsFortran.h b/Source/cmDependsFortran.h index f4385ebb9..b6de46ffb 100644 --- a/Source/cmDependsFortran.h +++ b/Source/cmDependsFortran.h @@ -12,10 +12,17 @@ #ifndef cmFortran_h #define cmFortran_h +#include +#include +#include +#include +#include + #include "cmDepends.h" class cmDependsFortranInternals; class cmFortranSourceInfo; +class cmLocalGenerator; /** \class cmDependsFortran * \brief Dependency scanner for Fortran object files. diff --git a/Source/cmDependsJava.cxx b/Source/cmDependsJava.cxx index a9130e67b..18bc69574 100644 --- a/Source/cmDependsJava.cxx +++ b/Source/cmDependsJava.cxx @@ -11,7 +11,6 @@ ============================================================================*/ #include "cmDependsJava.h" -#include "cmDependsJavaParserHelper.h" #include "cmSystemTools.h" cmDependsJava::cmDependsJava() diff --git a/Source/cmDependsJava.h b/Source/cmDependsJava.h index 5bb3039d0..95265c568 100644 --- a/Source/cmDependsJava.h +++ b/Source/cmDependsJava.h @@ -12,8 +12,15 @@ #ifndef cmDependsJava_h #define cmDependsJava_h +#include + #include "cmDepends.h" +#include +#include +#include +#include + /** \class cmDependsJava * \brief Dependency scanner for Java class files. */ diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index 79c466919..8d77ca62d 100644 --- a/Source/cmDependsJavaParserHelper.cxx +++ b/Source/cmDependsJavaParserHelper.cxx @@ -11,9 +11,16 @@ ============================================================================*/ #include "cmDependsJavaParserHelper.h" +#include + #include "cmDependsJavaLexer.h" #include "cmSystemTools.h" + #include +#include +#include +#include +#include int cmDependsJava_yyparse(yyscan_t yyscanner); diff --git a/Source/cmDependsJavaParserHelper.h b/Source/cmDependsJavaParserHelper.h index 377d5846c..731bbccfc 100644 --- a/Source/cmDependsJavaParserHelper.h +++ b/Source/cmDependsJavaParserHelper.h @@ -12,9 +12,10 @@ #ifndef cmDependsJavaParserHelper_h #define cmDependsJavaParserHelper_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include +#include #define YYSTYPE cmDependsJavaParserHelper::ParserType #define YYSTYPE_IS_DECLARED diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 5516cf12e..13736b912 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -12,17 +12,18 @@ #include "cmDocumentation.h" #include "cmAlgorithms.h" +#include "cmDocumentationEntry.h" +#include "cmDocumentationSection.h" #include "cmRST.h" #include "cmSystemTools.h" #include "cmVersion.h" -#include +#include #include #include - #include - -#include +#include +#include static const char* cmDocumentationStandardOptions[][2] = { { "--help,-help,-usage,-h,-H,/?", "Print usage information and exit." }, diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index c82e1d466..7661eb72d 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -14,15 +14,15 @@ #include -#include "cmStandardIncludes.h" - #include "cmDocumentationFormatter.h" -#include "cmDocumentationSection.h" -#include "cmake.h" -namespace cmsys { -class Directory; -} +#include +#include +#include +#include + +class cmDocumentationSection; +struct cmDocumentationEntry; /** Class to generate documentation. */ class cmDocumentation : public cmDocumentationEnums diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index 4816bb971..5a718a2fb 100644 --- a/Source/cmDocumentationFormatter.cxx +++ b/Source/cmDocumentationFormatter.cxx @@ -11,8 +11,14 @@ ============================================================================*/ #include "cmDocumentationFormatter.h" +#include "cmDocumentationEntry.h" #include "cmDocumentationSection.h" +#include +#include +#include +#include + cmDocumentationFormatter::cmDocumentationFormatter() : TextWidth(77) , TextIndent("") diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h index 7a931206b..09fb20ba3 100644 --- a/Source/cmDocumentationFormatter.h +++ b/Source/cmDocumentationFormatter.h @@ -12,9 +12,9 @@ #ifndef _cmDocumentationFormatter_h #define _cmDocumentationFormatter_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include /** This is just a helper class to make it build with MSVC 6.0. Actually the enums and internal classes could directly go into diff --git a/Source/cmDocumentationSection.h b/Source/cmDocumentationSection.h index 161a731bd..1d41070f6 100644 --- a/Source/cmDocumentationSection.h +++ b/Source/cmDocumentationSection.h @@ -12,7 +12,12 @@ #ifndef _cmDocumentationSection_h #define _cmDocumentationSection_h -#include "cmDocumentationFormatter.h" +#include // IWYU pragma: keep + +#include "cmDocumentationEntry.h" + +#include +#include // Low-level interface for custom documents: /** Internal class representing a section of the documentation. diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx index f6841ad54..762feee7c 100644 --- a/Source/cmDynamicLoader.cxx +++ b/Source/cmDynamicLoader.cxx @@ -11,6 +11,13 @@ ============================================================================*/ #include "cmDynamicLoader.h" +#include + +#include +#include +#include +#include + class cmDynamicLoaderCache { public: diff --git a/Source/cmDynamicLoader.h b/Source/cmDynamicLoader.h index d9b89905f..4f6ade5bc 100644 --- a/Source/cmDynamicLoader.h +++ b/Source/cmDynamicLoader.h @@ -17,9 +17,7 @@ #ifndef cmDynamicLoader_h #define cmDynamicLoader_h -#include - -#include "cmStandardIncludes.h" +#include // IWYU pragma: keep #include diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 150593bfe..6fff984dd 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -9,12 +9,16 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "cmStandardIncludes.h" // to get CMAKE_USE_ELF_PARSER first - #include "cmELF.h" #include +#include #include +#include +#include +#include +#include +#include // Include the ELF format information system header. #if defined(__OpenBSD__) diff --git a/Source/cmELF.h b/Source/cmELF.h index 80832ad41..a4c34566e 100644 --- a/Source/cmELF.h +++ b/Source/cmELF.h @@ -12,6 +12,11 @@ #ifndef cmELF_h #define cmELF_h +#include + +#include +#include + #if !defined(CMAKE_USE_ELF_PARSER) #error "This file may be included only if CMAKE_USE_ELF_PARSER is enabled." #endif diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 390477af3..8f4dfd874 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -12,9 +12,23 @@ #include "cmExportBuildFileGenerator.h" #include "cmExportSet.h" +#include "cmGeneratorExpression.h" +#include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" +#include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cmTarget.h" #include "cmTargetExport.h" +#include "cmake.h" + +#include +#include +#include +#include +#include cmExportBuildFileGenerator::cmExportBuildFileGenerator() { diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h index 417e8c928..990824f36 100644 --- a/Source/cmExportBuildFileGenerator.h +++ b/Source/cmExportBuildFileGenerator.h @@ -12,10 +12,18 @@ #ifndef cmExportBuildFileGenerator_h #define cmExportBuildFileGenerator_h +#include + #include "cmExportFileGenerator.h" -#include "cmListFileCache.h" + +#include +#include +#include class cmExportSet; +class cmGeneratorTarget; +class cmGlobalGenerator; +class cmLocalGenerator; /** \class cmExportBuildFileGenerator * \brief Generate a file exporting targets from a build tree. diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 7f01196c8..23c77d955 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -13,20 +13,25 @@ #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" -#include "cmExportSet.h" #include "cmGeneratedFileStream.h" -#include "cmGlobalGenerator.h" -#include "cmInstallExportGenerator.h" +#include "cmGeneratorTarget.h" +#include "cmLinkItem.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmOutputConverter.h" +#include "cmPolicies.h" +#include "cmState.h" #include "cmSystemTools.h" +#include "cmTarget.h" #include "cmTargetExport.h" -#include "cmVersion.h" +#include "cmake.h" #include #include #include +#include +#include +#include static std::string cmExportFileGeneratorEscape(std::string const& str) { diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h index 9c96015a6..354994a14 100644 --- a/Source/cmExportFileGenerator.h +++ b/Source/cmExportFileGenerator.h @@ -12,11 +12,19 @@ #ifndef cmExportFileGenerator_h #define cmExportFileGenerator_h -#include "cmCommand.h" -#include "cmGeneratorExpression.h" +#include // IWYU pragma: keep +#include "cmGeneratorExpression.h" #include "cmVersion.h" -#include "cmVersionMacros.h" +#include "cmVersionConfig.h" + +#include +#include +#include +#include +#include + +class cmGeneratorTarget; #define STRINGIFY_HELPER(X) #X #define STRINGIFY(X) STRINGIFY_HELPER(X) diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 77471574c..ceba69ac8 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -15,12 +15,22 @@ #include "cmExportSet.h" #include "cmExportSetMap.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorExpression.h" +#include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmInstallExportGenerator.h" #include "cmInstallTargetGenerator.h" #include "cmLocalGenerator.h" +#include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cmTarget.h" #include "cmTargetExport.h" +#include +#include + cmExportInstallFileGenerator::cmExportInstallFileGenerator( cmInstallExportGenerator* iegen) : IEGen(iegen) diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h index 68960dbe0..c693dc174 100644 --- a/Source/cmExportInstallFileGenerator.h +++ b/Source/cmExportInstallFileGenerator.h @@ -12,8 +12,18 @@ #ifndef cmExportInstallFileGenerator_h #define cmExportInstallFileGenerator_h +#include + #include "cmExportFileGenerator.h" +#include +#include +#include +#include +#include + +class cmGeneratorTarget; +class cmGlobalGenerator; class cmInstallExportGenerator; class cmInstallTargetGenerator; diff --git a/Source/cmExportSet.h b/Source/cmExportSet.h index 49f2cac3e..4f3c9d8eb 100644 --- a/Source/cmExportSet.h +++ b/Source/cmExportSet.h @@ -12,11 +12,14 @@ #ifndef cmExportSet_h #define cmExportSet_h -#include "cmSystemTools.h" +#include // IWYU pragma: keep + +#include +#include -class cmTargetExport; class cmInstallExportGenerator; class cmLocalGenerator; +class cmTargetExport; /// A set of targets that were installed with the same EXPORT parameter. class cmExportSet diff --git a/Source/cmExportSetMap.cxx b/Source/cmExportSetMap.cxx index ac1c66edb..42fb781c5 100644 --- a/Source/cmExportSetMap.cxx +++ b/Source/cmExportSetMap.cxx @@ -15,6 +15,8 @@ #include "cmAlgorithms.h" #include "cmExportSet.h" +#include + cmExportSet* cmExportSetMap::operator[](const std::string& name) { std::map::iterator it = this->find(name); diff --git a/Source/cmExportSetMap.h b/Source/cmExportSetMap.h index d2954e335..c3a55bab7 100644 --- a/Source/cmExportSetMap.h +++ b/Source/cmExportSetMap.h @@ -12,7 +12,10 @@ #ifndef cmExportSetMap_h #define cmExportSetMap_h -#include "cmSystemTools.h" +#include // IWYU pragma: keep + +#include +#include class cmExportSet; diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index 2916e6b2d..a0aefb8d0 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -12,10 +12,19 @@ #include "cmExportTryCompileFileGenerator.h" -#include "cmGeneratedFileStream.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorExpressionDAGChecker.h" +#include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" +#include "cmMakefile.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cm_auto_ptr.hxx" + +#include +#include cmExportTryCompileFileGenerator::cmExportTryCompileFileGenerator( cmGlobalGenerator* gg, const std::vector& targets, diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h index 1d13711da..27d5b3c1d 100644 --- a/Source/cmExportTryCompileFileGenerator.h +++ b/Source/cmExportTryCompileFileGenerator.h @@ -12,10 +12,18 @@ #ifndef cmExportTryCompileFileGenerator_h #define cmExportTryCompileFileGenerator_h +#include + #include "cmExportFileGenerator.h" -class cmInstallExportGenerator; -class cmInstallTargetGenerator; +#include +#include +#include +#include + +class cmGeneratorTarget; +class cmGlobalGenerator; +class cmMakefile; class cmExportTryCompileFileGenerator : public cmExportFileGenerator { diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx index 1a101ab16..3a76367bd 100644 --- a/Source/cmExprParserHelper.cxx +++ b/Source/cmExprParserHelper.cxx @@ -11,11 +11,13 @@ ============================================================================*/ #include "cmExprParserHelper.h" -#include "cmMakefile.h" -#include "cmSystemTools.h" +#include #include "cmExprLexer.h" +#include +#include + int cmExpr_yyparse(yyscan_t yyscanner); // cmExprParserHelper::cmExprParserHelper() diff --git a/Source/cmExprParserHelper.h b/Source/cmExprParserHelper.h index 8e3d9964c..74024840b 100644 --- a/Source/cmExprParserHelper.h +++ b/Source/cmExprParserHelper.h @@ -12,9 +12,10 @@ #ifndef cmExprParserHelper_h #define cmExprParserHelper_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include +#include #define YYSTYPE cmExprParserHelper::ParserType #define YYSTYPE_IS_DECLARED @@ -26,9 +27,6 @@ * * Finds dependencies for java file and list of outputs */ - -class cmMakefile; - class cmExprParserHelper { public: diff --git a/Source/cmExternalMakefileProjectGenerator.cxx b/Source/cmExternalMakefileProjectGenerator.cxx index b01290cf5..e4d124fc6 100644 --- a/Source/cmExternalMakefileProjectGenerator.cxx +++ b/Source/cmExternalMakefileProjectGenerator.cxx @@ -12,7 +12,7 @@ #include "cmExternalMakefileProjectGenerator.h" -#include +class cmMakefile; void cmExternalMakefileProjectGenerator::EnableLanguage( std::vector const& /*unused*/, cmMakefile* /*unused*/, diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h index 7d10ce1a5..b306f191f 100644 --- a/Source/cmExternalMakefileProjectGenerator.h +++ b/Source/cmExternalMakefileProjectGenerator.h @@ -12,13 +12,13 @@ #ifndef cmExternalMakefileProjectGenerator_h #define cmExternalMakefileProjectGenerator_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" - -#include "cmDocumentation.h" +#include +#include class cmGlobalGenerator; +class cmMakefile; /** \class cmExternalMakefileProjectGenerator * \brief Base class for generators for "External Makefile based IDE projects". diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 6eae26b5e..7eb3a740f 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -12,16 +12,23 @@ ============================================================================*/ #include "cmExtraCodeBlocksGenerator.h" +#include "cmAlgorithms.h" #include "cmGeneratedFileStream.h" -#include "cmGlobalUnixMakefileGenerator3.h" -#include "cmLocalUnixMakefileGenerator3.h" +#include "cmGeneratorTarget.h" +#include "cmGlobalGenerator.h" +#include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmSourceFile.h" +#include "cmState.h" #include "cmSystemTools.h" #include "cmXMLWriter.h" #include "cmake.h" -#include +#include +#include +#include +#include +#include /* Some useful URLs: Homepage: diff --git a/Source/cmExtraCodeBlocksGenerator.h b/Source/cmExtraCodeBlocksGenerator.h index b39080cd2..179be3055 100644 --- a/Source/cmExtraCodeBlocksGenerator.h +++ b/Source/cmExtraCodeBlocksGenerator.h @@ -13,11 +13,16 @@ #ifndef cmExtraCodeBlocksGenerator_h #define cmExtraCodeBlocksGenerator_h +#include + #include "cmExternalMakefileProjectGenerator.h" +#include +#include + +class cmGeneratorTarget; class cmLocalGenerator; class cmMakefile; -class cmGeneratorTarget; class cmXMLWriter; /** \class cmExtraCodeBlocksGenerator diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index eda686742..a039f49e3 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -14,18 +14,22 @@ #include "cmExtraCodeLiteGenerator.h" #include "cmGeneratedFileStream.h" -#include "cmGlobalUnixMakefileGenerator3.h" -#include "cmLocalUnixMakefileGenerator3.h" +#include "cmGeneratorTarget.h" +#include "cmGlobalGenerator.h" +#include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmSourceFile.h" +#include "cmState.h" #include "cmSystemTools.h" +#include "cmXMLWriter.h" #include "cmake.h" -#include "cmStandardIncludes.h" -#include "cmXMLWriter.h" -#include #include -#include +#include +#include +#include +#include +#include cmExtraCodeLiteGenerator::cmExtraCodeLiteGenerator() : cmExternalMakefileProjectGenerator() diff --git a/Source/cmExtraCodeLiteGenerator.h b/Source/cmExtraCodeLiteGenerator.h index e20e745f6..f5765d85d 100644 --- a/Source/cmExtraCodeLiteGenerator.h +++ b/Source/cmExtraCodeLiteGenerator.h @@ -14,9 +14,15 @@ #ifndef cmGlobalCodeLiteGenerator_h #define cmGlobalCodeLiteGenerator_h +#include + #include "cmExternalMakefileProjectGenerator.h" +#include +#include + class cmLocalGenerator; +class cmMakefile; class cmExtraCodeLiteGenerator : public cmExternalMakefileProjectGenerator { diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 945ee40bc..5a98e3482 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -14,17 +14,26 @@ #include "cmExtraEclipseCDT4Generator.h" #include "cmGeneratedFileStream.h" -#include "cmGlobalUnixMakefileGenerator3.h" -#include "cmLocalUnixMakefileGenerator3.h" +#include "cmGeneratorExpression.h" +#include "cmGeneratorTarget.h" +#include "cmGlobalGenerator.h" +#include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmOutputConverter.h" #include "cmSourceFile.h" +#include "cmSourceGroup.h" #include "cmState.h" -#include "cmTarget.h" -#include "cmXMLWriter.h" - #include "cmSystemTools.h" +#include "cmXMLWriter.h" +#include "cmake.h" + +#include #include -#include +#include +#include +#include +#include +#include static void AppendAttribute(cmXMLWriter& xml, const char* keyval) { diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h index 4b585c3fc..97b7bd7c0 100644 --- a/Source/cmExtraEclipseCDT4Generator.h +++ b/Source/cmExtraEclipseCDT4Generator.h @@ -14,11 +14,19 @@ #ifndef cmExtraEclipseCDT4Generator_h #define cmExtraEclipseCDT4Generator_h +#include + #include "cmExternalMakefileProjectGenerator.h" +#include +#include +#include +#include + +class cmLocalGenerator; class cmMakefile; -class cmXMLWriter; class cmSourceGroup; +class cmXMLWriter; /** \class cmExtraEclipseCDT4Generator * \brief Write Eclipse project files for Makefile based projects diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx index 4e7250471..36ab5b3b5 100644 --- a/Source/cmExtraKateGenerator.cxx +++ b/Source/cmExtraKateGenerator.cxx @@ -13,14 +13,18 @@ #include "cmExtraKateGenerator.h" #include "cmGeneratedFileStream.h" -#include "cmGlobalUnixMakefileGenerator3.h" -#include "cmLocalUnixMakefileGenerator3.h" +#include "cmGeneratorTarget.h" +#include "cmGlobalGenerator.h" +#include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmSourceFile.h" +#include "cmState.h" #include "cmSystemTools.h" -#include "cmake.h" -#include +#include +#include +#include +#include cmExtraKateGenerator::cmExtraKateGenerator() : cmExternalMakefileProjectGenerator() diff --git a/Source/cmExtraKateGenerator.h b/Source/cmExtraKateGenerator.h index 3d1605265..518deada2 100644 --- a/Source/cmExtraKateGenerator.h +++ b/Source/cmExtraKateGenerator.h @@ -13,10 +13,14 @@ #ifndef cmExtraKateGenerator_h #define cmExtraKateGenerator_h +#include + #include "cmExternalMakefileProjectGenerator.h" -class cmLocalGenerator; +#include + class cmGeneratedFileStream; +class cmLocalGenerator; /** \class cmExtraKateGenerator * \brief Write Kate project files for Makefile or ninja based projects diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 6e81ee1d7..8ee275ab3 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -14,15 +14,18 @@ #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" -#include "cmGlobalUnixMakefileGenerator3.h" +#include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" -#include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmSourceFile.h" +#include "cmState.h" #include "cmSystemTools.h" -#include "cmake.h" -#include +#include +#include +#include +#include +#include /* Sublime Text 2 Generator diff --git a/Source/cmExtraSublimeTextGenerator.h b/Source/cmExtraSublimeTextGenerator.h index c087825a9..ee2b25335 100644 --- a/Source/cmExtraSublimeTextGenerator.h +++ b/Source/cmExtraSublimeTextGenerator.h @@ -13,13 +13,19 @@ #ifndef cmExtraSublimeTextGenerator_h #define cmExtraSublimeTextGenerator_h -#include "cmExternalMakefileProjectGenerator.h" -#include "cmSourceFile.h" +#include + +#include "cmExternalMakefileProjectGenerator.h" + +#include +#include +#include -class cmLocalGenerator; -class cmMakefile; class cmGeneratedFileStream; class cmGeneratorTarget; +class cmLocalGenerator; +class cmMakefile; +class cmSourceFile; /** \class cmExtraSublimeTextGenerator * \brief Write Sublime Text 2 project files for Makefile based projects diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h index 38b90e1bf..90bb1b292 100644 --- a/Source/cmFileLock.h +++ b/Source/cmFileLock.h @@ -13,9 +13,9 @@ #ifndef cmFileLock_h #define cmFileLock_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include #if defined(_WIN32) #include // HANDLE diff --git a/Source/cmFileLockPool.h b/Source/cmFileLockPool.h index a3883dab4..d1883e7bb 100644 --- a/Source/cmFileLockPool.h +++ b/Source/cmFileLockPool.h @@ -12,14 +12,13 @@ #ifndef cmFileLockPool_h #define cmFileLockPool_h -#include - -#include "cmStandardIncludes.h" +#include // IWYU pragma: keep #include +#include -class cmFileLockResult; class cmFileLock; +class cmFileLockResult; class cmFileLockPool { diff --git a/Source/cmFileLockResult.cxx b/Source/cmFileLockResult.cxx index 090fe60f2..de851bce9 100644 --- a/Source/cmFileLockResult.cxx +++ b/Source/cmFileLockResult.cxx @@ -13,6 +13,7 @@ #include "cmFileLockResult.h" #include +#include cmFileLockResult cmFileLockResult::MakeOk() { diff --git a/Source/cmFileLockResult.h b/Source/cmFileLockResult.h index 10d4c13fd..54b9626e6 100644 --- a/Source/cmFileLockResult.h +++ b/Source/cmFileLockResult.h @@ -13,9 +13,9 @@ #ifndef cmFileLockResult_h #define cmFileLockResult_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include #if defined(_WIN32) #include // DWORD diff --git a/Source/cmFilePathUuid.cxx b/Source/cmFilePathUuid.cxx index f99646c79..b2def5190 100644 --- a/Source/cmFilePathUuid.cxx +++ b/Source/cmFilePathUuid.cxx @@ -17,6 +17,8 @@ #include "cmMakefile.h" #include "cmSystemTools.h" +#include + cmFilePathUuid::cmFilePathUuid(cmMakefile* makefile) { initParentDirs(makefile->GetCurrentSourceDirectory(), diff --git a/Source/cmFilePathUuid.h b/Source/cmFilePathUuid.h index 619c71b7d..87cfcf8a7 100644 --- a/Source/cmFilePathUuid.h +++ b/Source/cmFilePathUuid.h @@ -13,10 +13,9 @@ #ifndef cmFilePathUuid_h #define cmFilePathUuid_h -#include - -#include "cmStandardIncludes.h" +#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index 1360b44b4..089d52098 100644 --- a/Source/cmFileTimeComparison.cxx +++ b/Source/cmFileTimeComparison.cxx @@ -11,6 +11,11 @@ ============================================================================*/ #include "cmFileTimeComparison.h" +#include +#include +#include +#include + // Use a hash table to avoid duplicate file time checks from disk. #if defined(CMAKE_BUILD_WITH_CMAKE) #ifdef CMake_HAVE_CXX_UNORDERED_MAP @@ -20,16 +25,14 @@ #endif #endif -#include - // Use a platform-specific API to get file times efficiently. #if !defined(_WIN32) || defined(__CYGWIN__) -#define cmFileTimeComparison_Type struct stat -#include #include +#define cmFileTimeComparison_Type struct stat #else -#define cmFileTimeComparison_Type FILETIME +#include #include +#define cmFileTimeComparison_Type FILETIME #endif class cmFileTimeComparisonInternal diff --git a/Source/cmFileTimeComparison.h b/Source/cmFileTimeComparison.h index 52e974ccc..ea5c47ef2 100644 --- a/Source/cmFileTimeComparison.h +++ b/Source/cmFileTimeComparison.h @@ -12,9 +12,7 @@ #ifndef cmFileTimeComparison_h #define cmFileTimeComparison_h -#include - -#include "cmStandardIncludes.h" +#include // IWYU pragma: keep class cmFileTimeComparisonInternal; diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx index 30a33b4be..71edf9f7a 100644 --- a/Source/cmFortranParserImpl.cxx +++ b/Source/cmFortranParserImpl.cxx @@ -10,9 +10,16 @@ See the License for more information. ============================================================================*/ #include "cmFortranParser.h" - +#include "cmFortranLexer.h" #include "cmSystemTools.h" + #include +#include +#include +#include +#include +#include +#include bool cmFortranParser_s::FindIncludeFile(const char* dir, const char* includeName, diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index c35a1bcd0..9a8307052 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -13,6 +13,8 @@ #include "cmSystemTools.h" +#include + #if defined(CMAKE_BUILD_WITH_CMAKE) #include #endif diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h index e5e3320d0..4c4f26b2a 100644 --- a/Source/cmGeneratedFileStream.h +++ b/Source/cmGeneratedFileStream.h @@ -14,9 +14,8 @@ #include -#include "cmStandardIncludes.h" - #include +#include // This is the first base class of cmGeneratedFileStream. It will be // created before and destroyed after the ofstream portion and can diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 6cd643937..b016d9e2a 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -13,12 +13,14 @@ #include "assert.h" #include "cmAlgorithms.h" -#include "cmSystemTools.h" - -#include "cmGeneratorExpressionDAGChecker.h" +#include "cmGeneratorExpressionContext.h" #include "cmGeneratorExpressionEvaluator.h" #include "cmGeneratorExpressionLexer.h" #include "cmGeneratorExpressionParser.h" +#include "cmSystemTools.h" + +#include +#include cmGeneratorExpression::cmGeneratorExpression( const cmListFileBacktrace& backtrace) diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 75e69b4bc..24233b308 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -15,22 +15,20 @@ #include -#include "cmStandardIncludes.h" - #include "cmListFileCache.h" #include -#include - -class cmGeneratorTarget; -class cmLocalGenerator; -class cmListFileBacktrace; - -struct cmGeneratorExpressionEvaluator; -struct cmGeneratorExpressionContext; -struct cmGeneratorExpressionDAGChecker; +#include +#include +#include +#include class cmCompiledGeneratorExpression; +class cmGeneratorTarget; +class cmLocalGenerator; +struct cmGeneratorExpressionContext; +struct cmGeneratorExpressionDAGChecker; +struct cmGeneratorExpressionEvaluator; /** \class cmGeneratorExpression * \brief Evaluate generate-time query expression syntax. diff --git a/Source/cmGeneratorExpressionContext.cxx b/Source/cmGeneratorExpressionContext.cxx index 8da6b5021..77289d1fd 100644 --- a/Source/cmGeneratorExpressionContext.cxx +++ b/Source/cmGeneratorExpressionContext.cxx @@ -12,8 +12,6 @@ #include "cmGeneratorExpressionContext.h" -#include "cmGeneratorTarget.h" - cmGeneratorExpressionContext::cmGeneratorExpressionContext( cmLocalGenerator* lg, std::string const& config, bool quiet, cmGeneratorTarget const* headTarget, const cmGeneratorTarget* currentTarget, diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx index 045ded1b4..c47744347 100644 --- a/Source/cmGeneratorExpressionDAGChecker.cxx +++ b/Source/cmGeneratorExpressionDAGChecker.cxx @@ -13,7 +13,15 @@ #include "cmGeneratorExpressionDAGChecker.h" #include "cmAlgorithms.h" +#include "cmGeneratorExpressionContext.h" +#include "cmGeneratorExpressionEvaluator.h" +#include "cmGeneratorTarget.h" #include "cmLocalGenerator.h" +#include "cmake.h" + +#include +#include +#include cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker( const cmListFileBacktrace& backtrace, const std::string& target, diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h index e522728f2..c6d728181 100644 --- a/Source/cmGeneratorExpressionDAGChecker.h +++ b/Source/cmGeneratorExpressionDAGChecker.h @@ -14,9 +14,14 @@ #include -#include "cmStandardIncludes.h" +#include "cmListFileCache.h" -#include "cmGeneratorExpressionEvaluator.h" +#include +#include +#include + +struct GeneratorExpressionContent; +struct cmGeneratorExpressionContext; #define CM_SELECT_BOTH(F, A1, A2) F(A1, A2) #define CM_SELECT_FIRST(F, A1, A2) F(A1) diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index c01c4fc6b..aad9d1bfe 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -14,12 +14,17 @@ #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" +#include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmSourceFile.h" -#include +#include "cmSystemTools.h" +#include "cmake.h" -#include +#include +#include +#include +#include cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile( const std::string& input, diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h index 52ba2d8c2..3a668a22f 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.h +++ b/Source/cmGeneratorExpressionEvaluationFile.h @@ -12,10 +12,15 @@ #ifndef cmGeneratorExpressionEvaluationFile_h #define cmGeneratorExpressionEvaluationFile_h +#include // IWYU pragma: keep + #include "cmGeneratorExpression.h" #include +#include +#include #include +#include class cmLocalGenerator; diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index b4b74c5df..d21ab2576 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -12,21 +12,12 @@ #include "cmGeneratorExpressionEvaluator.h" #include "cmAlgorithms.h" -#include "cmGeneratorExpression.h" -#include "cmGeneratorExpressionDAGChecker.h" -#include "cmGeneratorExpressionParser.h" -#include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" -#include "cmMakefile.h" -#include "cmSourceFile.h" - -#include - -#include -#include - +#include "cmGeneratorExpressionContext.h" #include "cmGeneratorExpressionNode.h" +#include +#include + GeneratorExpressionContent::GeneratorExpressionContent( const char* startContent, size_t length) : StartContent(startContent) diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h index 58e732b92..5e8ebe0a5 100644 --- a/Source/cmGeneratorExpressionEvaluator.h +++ b/Source/cmGeneratorExpressionEvaluator.h @@ -12,13 +12,13 @@ #ifndef cmGeneratorExpressionEvaluator_h #define cmGeneratorExpressionEvaluator_h -#include "cmGeneratorExpressionContext.h" - -#include "cmListFileCache.h" +#include +#include #include #include +struct cmGeneratorExpressionContext; struct cmGeneratorExpressionDAGChecker; struct cmGeneratorExpressionNode; diff --git a/Source/cmGeneratorExpressionLexer.h b/Source/cmGeneratorExpressionLexer.h index 6bd336bce..55836aca5 100644 --- a/Source/cmGeneratorExpressionLexer.h +++ b/Source/cmGeneratorExpressionLexer.h @@ -12,10 +12,10 @@ #ifndef cmGeneratorExpressionLexer_h #define cmGeneratorExpressionLexer_h -#include - -#include "cmStandardIncludes.h" +#include // IWYU pragma: keep +#include +#include #include struct cmGeneratorExpressionToken diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 12cf98019..44e9ce19a 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -13,9 +13,36 @@ #include "cmGeneratorExpressionNode.h" #include "cmAlgorithms.h" +#include "cmGeneratorExpression.h" +#include "cmGeneratorExpressionContext.h" +#include "cmGeneratorExpressionDAGChecker.h" +#include "cmGeneratorExpressionEvaluator.h" +#include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" +#include "cmLinkItem.h" +#include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmOutputConverter.h" +#include "cmPolicies.h" +#include "cmSourceFile.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include std::string cmGeneratorExpressionNode::EvaluateDependentExpression( std::string const& prop, cmLocalGenerator* lg, @@ -1455,13 +1482,12 @@ static const struct InstallPrefixNode : public cmGeneratorExpressionNode } installPrefixNode; -class ArtifactNameTag; -class ArtifactLinkerTag; -class ArtifactSonameTag; -class ArtifactPdbTag; - -class ArtifactPathTag; class ArtifactDirTag; +class ArtifactLinkerTag; +class ArtifactNameTag; +class ArtifactPathTag; +class ArtifactPdbTag; +class ArtifactSonameTag; template struct TargetFilesystemArtifactResultCreator diff --git a/Source/cmGeneratorExpressionNode.h b/Source/cmGeneratorExpressionNode.h index 3ee57eb6d..23f405b40 100644 --- a/Source/cmGeneratorExpressionNode.h +++ b/Source/cmGeneratorExpressionNode.h @@ -12,20 +12,16 @@ #ifndef cmGeneratorExpressionNode_h #define cmGeneratorExpressionNode_h -#include "cmGeneratorExpression.h" +#include // IWYU pragma: keep -#include "cmGeneratorExpressionDAGChecker.h" -#include "cmGeneratorExpressionEvaluator.h" -#include "cmGeneratorExpressionParser.h" -#include "cmLocalGenerator.h" -#include "cmSourceFile.h" +#include +#include -#include - -#include -#include - -#include "cmListFileCache.h" +class cmGeneratorTarget; +class cmLocalGenerator; +struct GeneratorExpressionContent; +struct cmGeneratorExpressionContext; +struct cmGeneratorExpressionDAGChecker; struct cmGeneratorExpressionNode { diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx index f853f8d65..c753f9b9c 100644 --- a/Source/cmGeneratorExpressionParser.cxx +++ b/Source/cmGeneratorExpressionParser.cxx @@ -14,7 +14,8 @@ #include "cmGeneratorExpressionEvaluator.h" -#include "assert.h" +#include +#include cmGeneratorExpressionParser::cmGeneratorExpressionParser( const std::vector& tokens) diff --git a/Source/cmGeneratorExpressionParser.h b/Source/cmGeneratorExpressionParser.h index b0e9ea449..4534d6bbe 100644 --- a/Source/cmGeneratorExpressionParser.h +++ b/Source/cmGeneratorExpressionParser.h @@ -12,12 +12,11 @@ #ifndef cmGeneratorExpressionParser_h #define cmGeneratorExpressionParser_h -#include "cmGeneratorExpressionLexer.h" +#include // IWYU pragma: keep -#include #include -#include "cmListFileCache.h" +#include "cmGeneratorExpressionLexer.h" struct cmGeneratorExpressionEvaluator; diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 8bd3b8295..ee2907cab 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -13,19 +13,33 @@ #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" +#include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" +#include "cmCustomCommandLines.h" #include "cmGeneratorExpression.h" #include "cmGeneratorExpressionDAGChecker.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmPropertyMap.h" #include "cmSourceFile.h" +#include "cmSourceFileLocation.h" +#include "cmSystemTools.h" #include "cmTarget.h" +#include "cmTargetLinkLibraryType.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" -#include - -#include "assert.h" +#include +#include +#include #include +#include +#include +#include +#include +#include +#include #if defined(CMake_HAVE_CXX_UNORDERED_SET) #include diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index f9987aa6f..173f15dc4 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -12,15 +12,26 @@ #ifndef cmGeneratorTarget_h #define cmGeneratorTarget_h -#include "cmLinkItem.h" +#include +#include "cmLinkItem.h" +#include "cmListFileCache.h" +#include "cmPolicies.h" +#include "cmState.h" + +#include +#include +#include +#include +#include + +class cmComputeLinkInformation; class cmCustomCommand; class cmGlobalGenerator; class cmLocalGenerator; class cmMakefile; class cmSourceFile; class cmTarget; -class cmComputeLinkInformation; class cmGeneratorTarget { diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index 3d35114eb..d3c9625c4 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -12,6 +12,7 @@ #include "cmGhsMultiTargetGenerator.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorTarget.h" #include "cmGlobalGhsMultiGenerator.h" #include "cmLocalGhsMultiGenerator.h" #include "cmMakefile.h" diff --git a/Source/cmGlobalCommonGenerator.cxx b/Source/cmGlobalCommonGenerator.cxx index 900b08e19..d8ea317c2 100644 --- a/Source/cmGlobalCommonGenerator.cxx +++ b/Source/cmGlobalCommonGenerator.cxx @@ -11,6 +11,8 @@ ============================================================================*/ #include "cmGlobalCommonGenerator.h" +class cmake; + cmGlobalCommonGenerator::cmGlobalCommonGenerator(cmake* cm) : cmGlobalGenerator(cm) { diff --git a/Source/cmGlobalCommonGenerator.h b/Source/cmGlobalCommonGenerator.h index a48ff4f38..5bc16c3d0 100644 --- a/Source/cmGlobalCommonGenerator.h +++ b/Source/cmGlobalCommonGenerator.h @@ -12,8 +12,12 @@ #ifndef cmGlobalCommonGenerator_h #define cmGlobalCommonGenerator_h +#include + #include "cmGlobalGenerator.h" +class cmake; + /** \class cmGlobalCommonGenerator * \brief Common infrastructure for Makefile and Ninja global generators. */ diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 50c5a42c9..ef8266ff2 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -21,6 +21,8 @@ #include "cmAlgorithms.h" #include "cmCPackPropertiesGenerator.h" #include "cmComputeTargetDepends.h" +#include "cmCustomCommand.h" +#include "cmCustomCommandLines.h" #include "cmExportBuildFileGenerator.h" #include "cmExternalMakefileProjectGenerator.h" #include "cmGeneratedFileStream.h" @@ -29,25 +31,31 @@ #include "cmInstallGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmOutputConverter.h" +#include "cmPolicies.h" #include "cmQtAutoGeneratorInitializer.h" #include "cmSourceFile.h" #include "cmState.h" -#include "cmTargetExport.h" #include "cmVersion.h" #include "cmake.h" +#include +#include #include #include +#include +#include +#include +#include +#include #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cm_jsoncpp_value.h" -#include "cm_jsoncpp_writer.h" +#include +#include #include #endif -#include // required for atof - -#include +class cmInstalledFile; bool cmTarget::StrictTargetComparison::operator()(cmTarget const* t1, cmTarget const* t2) const diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index dc80a33e4..1e1479a9f 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -15,15 +15,18 @@ #include -#include "cmStandardIncludes.h" - -#include "cmExportSetMap.h" // For cmExportSetMap -#include "cmGeneratorExpression.h" -#include "cmGeneratorTarget.h" +#include "cmExportSetMap.h" #include "cmState.h" -#include "cmSystemTools.h" // for cmSystemTools::OutputOption -#include "cmTarget.h" // For cmTargets -#include "cmTargetDepend.h" // For cmTargetDependSet +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmTargetDepend.h" + +#include +#include +#include +#include +#include +#include #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmFileLockPool.h" @@ -34,15 +37,14 @@ #endif #endif -class cmake; -class cmGeneratorTarget; -class cmMakefile; -class cmLocalGenerator; -class cmExternalMakefileProjectGenerator; -class cmTarget; -class cmInstallTargetGenerator; -class cmInstallFilesGenerator; +class cmCustomCommandLines; +class cmSourceFile; class cmExportBuildFileGenerator; +class cmExternalMakefileProjectGenerator; +class cmGeneratorTarget; +class cmLocalGenerator; +class cmMakefile; +class cmake; /** \class cmGlobalGenerator * \brief Responsible for overseeing the generation process for the entire tree diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index 0ae913e24..d75ebf81a 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -12,6 +12,7 @@ #include "cmGlobalGhsMultiGenerator.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorTarget.h" #include "cmGhsMultiTargetGenerator.h" #include "cmLocalGhsMultiGenerator.h" #include "cmMakefile.h" diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index daf70031c..aaa1108ed 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -13,17 +13,23 @@ #include "cmGlobalKdevelopGenerator.h" #include "cmGeneratedFileStream.h" -#include "cmGlobalUnixMakefileGenerator3.h" -#include "cmLocalUnixMakefileGenerator3.h" +#include "cmGeneratorTarget.h" +#include "cmGlobalGenerator.h" +#include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmSourceFile.h" +#include "cmState.h" #include "cmSystemTools.h" +#include "cmTarget.h" #include "cmXMLWriter.h" #include "cmake.h" #include #include -#include +#include +#include +#include +#include cmGlobalKdevelopGenerator::cmGlobalKdevelopGenerator() : cmExternalMakefileProjectGenerator() diff --git a/Source/cmGlobalKdevelopGenerator.h b/Source/cmGlobalKdevelopGenerator.h index 666527c10..6a201b012 100644 --- a/Source/cmGlobalKdevelopGenerator.h +++ b/Source/cmGlobalKdevelopGenerator.h @@ -13,8 +13,13 @@ #ifndef cmGlobalKdevelopGenerator_h #define cmGlobalKdevelopGenerator_h +#include + #include "cmExternalMakefileProjectGenerator.h" +#include +#include + class cmLocalGenerator; /** \class cmGlobalKdevelopGenerator diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 590f20725..30a05a00d 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -13,16 +13,27 @@ #include "cmGlobalNinjaGenerator.h" #include "cmAlgorithms.h" +#include "cmDocumentationEntry.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorExpressionEvaluationFile.h" #include "cmGeneratorTarget.h" +#include "cmLocalGenerator.h" #include "cmLocalNinjaGenerator.h" #include "cmMakefile.h" +#include "cmOutputConverter.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmTargetDepend.h" #include "cmVersion.h" +#include "cmake.h" #include -#include #include +#include +#include +#include +#include const char* cmGlobalNinjaGenerator::NINJA_BUILD_FILE = "build.ninja"; const char* cmGlobalNinjaGenerator::NINJA_RULES_FILE = "rules.ninja"; diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 082ee3aba..a0fad644b 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -13,16 +13,28 @@ #ifndef cmGlobalNinjaGenerator_h #define cmGlobalNinjaGenerator_h -#include "cmGlobalCommonGenerator.h" +#include +#include "cmGlobalCommonGenerator.h" +#include "cmGlobalGenerator.h" #include "cmGlobalGeneratorFactory.h" #include "cmNinjaTypes.h" +#include "cmPolicies.h" -//#define NINJA_GEN_VERBOSE_FILES +#include +#include +#include +#include +#include +#include -class cmLocalGenerator; +class cmCustomCommand; +class cmMakefile; +class cmake; +struct cmDocumentationEntry; class cmGeneratedFileStream; class cmGeneratorTarget; +class cmLocalGenerator; /** * \class cmGlobalNinjaGenerator diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 77fbbe940..d90ebf087 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -12,13 +12,25 @@ #include "cmGlobalUnixMakefileGenerator3.h" #include "cmAlgorithms.h" +#include "cmDocumentationEntry.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" +#include "cmGlobalGenerator.h" +#include "cmLocalGenerator.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmMakefileTargetGenerator.h" +#include "cmOutputConverter.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmTargetDepend.h" #include "cmake.h" +#include +#include +#include +#include + cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3(cmake* cm) : cmGlobalCommonGenerator(cm) { diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index ceb4140bf..372412445 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -12,13 +12,27 @@ #ifndef cmGlobalUnixMakefileGenerator3_h #define cmGlobalUnixMakefileGenerator3_h -#include "cmGlobalCommonGenerator.h" +#include +#include "cmGeneratorTarget.h" +#include "cmGlobalCommonGenerator.h" #include "cmGlobalGeneratorFactory.h" +#include "cmState.h" + +#include +#include +#include +#include +#include +#include class cmGeneratedFileStream; -class cmMakefileTargetGenerator; +class cmLocalGenerator; class cmLocalUnixMakefileGenerator3; +class cmMakefile; +class cmMakefileTargetGenerator; +class cmake; +struct cmDocumentationEntry; /** \class cmGlobalUnixMakefileGenerator3 * \brief Write a Unix makefiles. diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index df831e55b..819feb1e8 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -14,6 +14,7 @@ #include "cmGlobalVisualStudio10Generator.h" #include "cmAlgorithms.h" +#include "cmGeneratorTarget.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" #include "cmSourceFile.h" diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 45d952216..ea008ad6e 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -13,6 +13,7 @@ #include "cmGlobalVisualStudio71Generator.h" +#include "cmGeneratorTarget.h" #include "cmLocalVisualStudio7Generator.h" #include "cmMakefile.h" #include "cmake.h" diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 67ac230ca..08be30470 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -14,6 +14,7 @@ #include "cmGlobalVisualStudio7Generator.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorTarget.h" #include "cmLocalVisualStudio7Generator.h" #include "cmMakefile.h" #include "cmUuid.h" diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 2c0168e1b..53a05a0fb 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -14,6 +14,7 @@ #include "cmGlobalVisualStudio8Generator.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorTarget.h" #include "cmLocalVisualStudio7Generator.h" #include "cmMakefile.h" #include "cmSourceFile.h" diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx index 86fe6f27d..d8f1d93ac 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.cxx +++ b/Source/cmGlobalWatcomWMakeGenerator.cxx @@ -11,8 +11,10 @@ ============================================================================*/ #include "cmGlobalWatcomWMakeGenerator.h" -#include "cmLocalUnixMakefileGenerator3.h" +#include "cmDocumentationEntry.h" #include "cmMakefile.h" +#include "cmState.h" +#include "cmake.h" cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator(cmake* cm) : cmGlobalUnixMakefileGenerator3(cm) diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h index bc0d786ae..df1168ed2 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.h +++ b/Source/cmGlobalWatcomWMakeGenerator.h @@ -12,8 +12,18 @@ #ifndef cmGlobalWatcomWMakeGenerator_h #define cmGlobalWatcomWMakeGenerator_h +#include + +#include "cmGlobalGeneratorFactory.h" #include "cmGlobalUnixMakefileGenerator3.h" +#include +#include + +class cmMakefile; +class cmake; +struct cmDocumentationEntry; + /** \class cmGlobalWatcomWMakeGenerator * \brief Write a NMake makefiles. * diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index adb9936a1..2824f7e90 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -12,9 +12,19 @@ #include "cmGraphVizWriter.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" + +#include +#include +#include +#include static const char* getShapeForTarget(const cmGeneratorTarget* target) { diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h index 06437854f..f34e96792 100644 --- a/Source/cmGraphVizWriter.h +++ b/Source/cmGraphVizWriter.h @@ -12,15 +12,19 @@ #ifndef CMGRAPHVIZWRITER_H #define CMGRAPHVIZWRITER_H -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include "cmState.h" -#include "cmGeneratedFileStream.h" -#include "cmLocalGenerator.h" #include +#include +#include +#include +#include +class cmGeneratedFileStream; class cmGeneratorTarget; +class cmLocalGenerator; /** This class implements writing files for graphviz (dot) for graphs * representing the dependencies between the targets in the project. */ diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx index 469b1193d..3b4226d0b 100644 --- a/Source/cmInstallDirectoryGenerator.cxx +++ b/Source/cmInstallDirectoryGenerator.cxx @@ -12,8 +12,11 @@ #include "cmInstallDirectoryGenerator.h" #include "cmGeneratorExpression.h" +#include "cmInstallType.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" cmInstallDirectoryGenerator::cmInstallDirectoryGenerator( std::vector const& dirs, const char* dest, diff --git a/Source/cmInstallDirectoryGenerator.h b/Source/cmInstallDirectoryGenerator.h index 93becf4dc..ed4078531 100644 --- a/Source/cmInstallDirectoryGenerator.h +++ b/Source/cmInstallDirectoryGenerator.h @@ -13,6 +13,14 @@ #define cmInstallDirectoryGenerator_h #include "cmInstallGenerator.h" +#include "cmScriptGenerator.h" + +#include +#include +#include +#include + +class cmLocalGenerator; /** \class cmInstallDirectoryGenerator * \brief Generate directory installation rules. diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index 72c4d1f69..27628f423 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -11,19 +11,17 @@ ============================================================================*/ #include "cmInstallExportGenerator.h" -#include - -#include "cmGeneratedFileStream.h" -#include "cmGlobalGenerator.h" -#include "cmInstallTargetGenerator.h" -#include "cmLocalGenerator.h" -#include "cmMakefile.h" -#include "cmake.h" - -#include "cmInstallFilesGenerator.h" +#include +#include +#include +#include #include "cmExportInstallFileGenerator.h" #include "cmExportSet.h" +#include "cmInstallType.h" +#include "cmLocalGenerator.h" +#include "cmSystemTools.h" +#include "cmake.h" cmInstallExportGenerator::cmInstallExportGenerator( cmExportSet* exportSet, const char* destination, diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h index 22e661b1f..55398278c 100644 --- a/Source/cmInstallExportGenerator.h +++ b/Source/cmInstallExportGenerator.h @@ -12,13 +12,19 @@ #ifndef cmInstallExportGenerator_h #define cmInstallExportGenerator_h +#include + #include "cmInstallGenerator.h" +#include "cmScriptGenerator.h" + +#include +#include +#include +#include class cmExportInstallFileGenerator; -class cmInstallFilesGenerator; -class cmInstallTargetGenerator; class cmExportSet; -class cmMakefile; +class cmLocalGenerator; /** \class cmInstallExportGenerator * \brief Generate rules for creating an export files. diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx index 93a740cb4..1d0faddef 100644 --- a/Source/cmInstallFilesGenerator.cxx +++ b/Source/cmInstallFilesGenerator.cxx @@ -12,9 +12,11 @@ #include "cmInstallFilesGenerator.h" #include "cmGeneratorExpression.h" -#include "cmLocalGenerator.h" -#include "cmMakefile.h" +#include "cmInstallType.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" + +class cmLocalGenerator; cmInstallFilesGenerator::cmInstallFilesGenerator( std::vector const& files, const char* dest, bool programs, diff --git a/Source/cmInstallFilesGenerator.h b/Source/cmInstallFilesGenerator.h index 5cb09f45e..1648976e5 100644 --- a/Source/cmInstallFilesGenerator.h +++ b/Source/cmInstallFilesGenerator.h @@ -12,7 +12,16 @@ #ifndef cmInstallFilesGenerator_h #define cmInstallFilesGenerator_h +#include + #include "cmInstallGenerator.h" +#include "cmScriptGenerator.h" + +#include +#include +#include + +class cmLocalGenerator; /** \class cmInstallFilesGenerator * \brief Generate file installation rules. diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx index e3d5badc0..69120a836 100644 --- a/Source/cmInstallGenerator.cxx +++ b/Source/cmInstallGenerator.cxx @@ -14,6 +14,8 @@ #include "cmMakefile.h" #include "cmSystemTools.h" +#include + cmInstallGenerator::cmInstallGenerator( const char* destination, std::vector const& configurations, const char* component, MessageLevel message, bool exclude_from_all) diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h index ad9fc2851..fa0bdd695 100644 --- a/Source/cmInstallGenerator.h +++ b/Source/cmInstallGenerator.h @@ -12,9 +12,15 @@ #ifndef cmInstallGenerator_h #define cmInstallGenerator_h +#include + #include "cmInstallType.h" #include "cmScriptGenerator.h" +#include +#include +#include + class cmLocalGenerator; class cmMakefile; diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx index 76d6b718f..78711000e 100644 --- a/Source/cmInstallScriptGenerator.cxx +++ b/Source/cmInstallScriptGenerator.cxx @@ -11,6 +11,11 @@ ============================================================================*/ #include "cmInstallScriptGenerator.h" +#include "cmScriptGenerator.h" + +#include +#include + cmInstallScriptGenerator::cmInstallScriptGenerator(const char* script, bool code, const char* component, diff --git a/Source/cmInstallScriptGenerator.h b/Source/cmInstallScriptGenerator.h index dc00359f3..609294f8c 100644 --- a/Source/cmInstallScriptGenerator.h +++ b/Source/cmInstallScriptGenerator.h @@ -12,8 +12,13 @@ #ifndef cmInstallScriptGenerator_h #define cmInstallScriptGenerator_h +#include + #include "cmInstallGenerator.h" +#include +#include + /** \class cmInstallScriptGenerator * \brief Generate target installation rules. */ diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 4b2f40cb9..1ad59ffdc 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -14,13 +14,21 @@ #include "cmComputeLinkInformation.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" -#include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" +#include "cmInstallType.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" #include +#include +#include +#include +#include cmInstallTargetGenerator::cmInstallTargetGenerator( const std::string& targetName, const char* dest, bool implib, diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h index b1c28b8ed..797e962c2 100644 --- a/Source/cmInstallTargetGenerator.h +++ b/Source/cmInstallTargetGenerator.h @@ -12,9 +12,17 @@ #ifndef cmInstallTargetGenerator_h #define cmInstallTargetGenerator_h +#include + #include "cmInstallGenerator.h" +#include "cmScriptGenerator.h" + +#include +#include +#include class cmGeneratorTarget; +class cmLocalGenerator; /** \class cmInstallTargetGenerator * \brief Generate target installation rules. diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx index bfc5cf123..3ab7db016 100644 --- a/Source/cmInstalledFile.cxx +++ b/Source/cmInstalledFile.cxx @@ -12,9 +12,13 @@ #include "cmInstalledFile.h" #include "cmAlgorithms.h" +#include "cmListFileCache.h" #include "cmMakefile.h" #include "cmSystemTools.h" +#include +#include + cmInstalledFile::cmInstalledFile() : NameExpression(CM_NULLPTR) { diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h index 00ff611e8..8bad5a582 100644 --- a/Source/cmInstalledFile.h +++ b/Source/cmInstalledFile.h @@ -13,6 +13,13 @@ #define cmInstalledFile_h #include "cmGeneratorExpression.h" +#include "cm_auto_ptr.hxx" + +#include +#include +#include + +class cmMakefile; /** \class cmInstalledFile * \brief Represents a file intended for installation. diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index aad538ca6..14bb81e16 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -15,9 +15,12 @@ #include "cmMessenger.h" #include "cmOutputConverter.h" #include "cmSystemTools.h" -#include "cmVersion.h" +#include "cmake.h" -#include +#include +#include +#include +#include struct cmListFileParser { diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 08b59ebd5..215f17908 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -12,9 +12,11 @@ #ifndef cmListFileCache_h #define cmListFileCache_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include +#include +#include #include "cmState.h" @@ -151,6 +153,7 @@ public: private: struct Entry; + cmState::Snapshot Bottom; Entry* Cur; cmListFileBacktrace(cmState::Snapshot bottom, Entry* up, diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx index 138342125..0e7929356 100644 --- a/Source/cmLocalCommonGenerator.cxx +++ b/Source/cmLocalCommonGenerator.cxx @@ -11,8 +11,13 @@ ============================================================================*/ #include "cmLocalCommonGenerator.h" +#include "cmGeneratorTarget.h" #include "cmMakefile.h" +#include + +class cmGlobalGenerator; + cmLocalCommonGenerator::cmLocalCommonGenerator( cmGlobalGenerator* gg, cmMakefile* mf, cmOutputConverter::RelativeRoot wd) : cmLocalGenerator(gg, mf) diff --git a/Source/cmLocalCommonGenerator.h b/Source/cmLocalCommonGenerator.h index 0a8753d2c..9012afd4b 100644 --- a/Source/cmLocalCommonGenerator.h +++ b/Source/cmLocalCommonGenerator.h @@ -12,9 +12,16 @@ #ifndef cmLocalCommonGenerator_h #define cmLocalCommonGenerator_h -#include "cmLocalGenerator.h" +#include -class cmCommonTargetGenerator; +#include "cmLocalGenerator.h" +#include "cmOutputConverter.h" + +#include + +class cmGeneratorTarget; +class cmGlobalGenerator; +class cmMakefile; /** \class cmLocalCommonGenerator * \brief Common infrastructure for Makefile and Ninja local generators. diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index de9e1e551..cecf7b722 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -16,14 +16,15 @@ #include "cmCustomCommandGenerator.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorExpressionEvaluationFile.h" +#include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" -#include "cmInstallFilesGenerator.h" #include "cmInstallGenerator.h" #include "cmInstallScriptGenerator.h" #include "cmInstallTargetGenerator.h" #include "cmMakefile.h" #include "cmSourceFile.h" -#include "cmTest.h" +#include "cmSystemTools.h" +#include "cmTarget.h" #include "cmTestGenerator.h" #include "cmVersion.h" #include "cmake.h" @@ -33,9 +34,14 @@ #include #endif -#include // for isalpha - +#include #include +#include +#include +#include +#include +#include +#include #if defined(__HAIKU__) #include diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index f7a4074f3..a43a7d10f 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -14,19 +14,25 @@ #include -#include "cmStandardIncludes.h" - +#include "cmListFileCache.h" #include "cmOutputConverter.h" +#include "cmPolicies.h" #include "cmState.h" #include "cmake.h" -class cmMakefile; -class cmGlobalGenerator; -class cmGeneratorTarget; -class cmTargetManifest; -class cmSourceFile; -class cmCustomCommand; +#include +#include +#include +#include +#include +#include +#include + class cmCustomCommandGenerator; +class cmGeneratorTarget; +class cmGlobalGenerator; +class cmMakefile; +class cmSourceFile; /** \class cmLocalGenerator * \brief Create required build files for a directory. diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index d15ee220e..6793f8450 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -12,16 +12,25 @@ ============================================================================*/ #include "cmLocalNinjaGenerator.h" +#include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorTarget.h" +#include "cmGlobalGenerator.h" #include "cmGlobalNinjaGenerator.h" #include "cmMakefile.h" #include "cmNinjaTargetGenerator.h" #include "cmSourceFile.h" #include "cmState.h" +#include "cmSystemTools.h" #include "cmake.h" +#include #include +#include +#include +#include +#include cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmGlobalGenerator* gg, cmMakefile* mf) diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index 6e6108793..25539d4f1 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -13,13 +13,27 @@ #ifndef cmLocalNinjaGenerator_h #define cmLocalNinjaGenerator_h +#include + #include "cmLocalCommonGenerator.h" - +#include "cmLocalGenerator.h" #include "cmNinjaTypes.h" +#include "cmOutputConverter.h" +#include +#include +#include +#include +#include + +class cmCustomCommand; class cmCustomCommandGenerator; -class cmGlobalNinjaGenerator; class cmGeneratedFileStream; +class cmGeneratorTarget; +class cmGlobalGenerator; +class cmGlobalNinjaGenerator; +class cmMakefile; +class cmSourceFile; class cmake; /** diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 3c4841eca..611c50281 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -12,13 +12,20 @@ #include "cmLocalUnixMakefileGenerator3.h" #include "cmAlgorithms.h" +#include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" #include "cmFileTimeComparison.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorTarget.h" +#include "cmGlobalGenerator.h" #include "cmGlobalUnixMakefileGenerator3.h" +#include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmMakefileTargetGenerator.h" +#include "cmOutputConverter.h" #include "cmSourceFile.h" +#include "cmState.h" +#include "cmSystemTools.h" #include "cmVersion.h" #include "cmake.h" @@ -30,11 +37,14 @@ #include "cmDependsJava.h" #endif -#include -#include - #include -#include +#include +#include +#include +#include +#include +#include +#include // Escape special characters in Makefile dependency lines class cmMakeSafe diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 3e90055a9..bd32e1038 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -12,15 +12,22 @@ #ifndef cmLocalUnixMakefileGenerator3_h #define cmLocalUnixMakefileGenerator3_h +#include + +#include "cmDepends.h" #include "cmLocalCommonGenerator.h" -// for cmDepends::DependencyVector -#include "cmDepends.h" +#include +#include +#include +#include +#include class cmCustomCommand; class cmCustomCommandGenerator; -class cmDepends; -class cmMakefileTargetGenerator; +class cmGeneratorTarget; +class cmGlobalGenerator; +class cmMakefile; class cmSourceFile; /** \class cmLocalUnixMakefileGenerator3 diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index 37b5505f6..0fe7987bf 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -11,10 +11,12 @@ ============================================================================*/ #include "cmLocalVisualStudio10Generator.h" +#include "cmGeneratorTarget.h" #include "cmGlobalVisualStudio10Generator.h" #include "cmMakefile.h" #include "cmVisualStudio10TargetGenerator.h" #include "cmXMLParser.h" + #include class cmVS10XMLParser : public cmXMLParser diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index b49296222..d344dc572 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -12,6 +12,7 @@ #include "cmLocalVisualStudioGenerator.h" #include "cmCustomCommandGenerator.h" +#include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmSourceFile.h" diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx index db8794690..098779e3e 100644 --- a/Source/cmLocalXCodeGenerator.cxx +++ b/Source/cmLocalXCodeGenerator.cxx @@ -11,6 +11,7 @@ ============================================================================*/ #include "cmLocalXCodeGenerator.h" +#include "cmGeneratorTarget.h" #include "cmGlobalXCodeGenerator.h" #include "cmMakefile.h" #include "cmSourceFile.h" diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d1fddca27..11ccca122 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -23,34 +23,35 @@ #include "cmGeneratorExpression.h" #include "cmGeneratorExpressionEvaluationFile.h" #include "cmGlobalGenerator.h" -#include "cmInstallGenerator.h" #include "cmListFileCache.h" -#include "cmMessenger.h" #include "cmSourceFile.h" #include "cmSourceFileLocation.h" #include "cmState.h" #include "cmSystemTools.h" #include "cmTest.h" -#include "cmTestGenerator.h" #include "cmVersion.h" #include "cmake.h" +#include "cmInstallGenerator.h" // IWYU pragma: keep +#include "cmTestGenerator.h" // IWYU pragma: keep + #ifdef CMAKE_BUILD_WITH_CMAKE #include "cmVariableWatch.h" #endif +#include +#include #include #include #include - -#include -#include #include #include #include #include #include +class cmMessenger; + // default is not to be building executables cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator, cmState::Snapshot const& snapshot) diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 4d137db67..eb382dfc6 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -54,6 +54,7 @@ class cmFunctionBlocker; class cmGeneratorExpressionEvaluationFile; class cmGlobalGenerator; class cmInstallGenerator; +class cmMessenger; class cmSourceFile; class cmTest; class cmTestGenerator; @@ -892,10 +893,13 @@ private: void PopSnapshot(bool reportError = true); friend class cmCMakePolicyCommand; class IncludeScope; + friend class IncludeScope; class ListFileScope; + friend class ListFileScope; class BuildsystemFileScope; + friend class BuildsystemFileScope; // CMP0053 == old diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx index 43fa15067..fe6705064 100644 --- a/Source/cmMessenger.cxx +++ b/Source/cmMessenger.cxx @@ -11,14 +11,18 @@ ============================================================================*/ #include "cmMessenger.h" + +#include "cmAlgorithms.h" #include "cmDocumentationFormatter.h" -#include "cmMessenger.h" -#include "cmOutputConverter.h" +#include "cmState.h" +#include "cmSystemTools.h" #if defined(CMAKE_BUILD_WITH_CMAKE) #include #endif +#include + cmake::MessageType cmMessenger::ConvertMessageType(cmake::MessageType t) const { bool warningsAsErrors; diff --git a/Source/cmMessenger.h b/Source/cmMessenger.h index f15bf1392..c69eb8ec0 100644 --- a/Source/cmMessenger.h +++ b/Source/cmMessenger.h @@ -13,10 +13,15 @@ #ifndef cmMessenger_h #define cmMessenger_h +#include // IWYU pragma: keep + #include "cmListFileCache.h" -#include "cmState.h" #include "cmake.h" +#include + +class cmState; + class cmMessenger { public: diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx index dbfe6eb34..3ddcc9a8b 100644 --- a/Source/cmOSXBundleGenerator.cxx +++ b/Source/cmOSXBundleGenerator.cxx @@ -11,12 +11,18 @@ ============================================================================*/ #include "cmOSXBundleGenerator.h" +#include + +#include "cmGeneratorTarget.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmSystemTools.h" #include "cmTarget.h" #include +class cmSourceFile; + cmOSXBundleGenerator::cmOSXBundleGenerator(cmGeneratorTarget* target, const std::string& configName) : GT(target) diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h index 2dc1e4a44..ff472eced 100644 --- a/Source/cmOSXBundleGenerator.h +++ b/Source/cmOSXBundleGenerator.h @@ -12,19 +12,16 @@ #ifndef cmOSXBundleGenerator_h #define cmOSXBundleGenerator_h -#include - -#include "cmStandardIncludes.h" - -#include "cmSourceFile.h" +#include // IWYU pragma: keep #include #include +#include -class cmTarget; -class cmMakefile; -class cmLocalGenerator; class cmGeneratorTarget; +class cmLocalGenerator; +class cmMakefile; +class cmSourceFile; class cmOSXBundleGenerator { diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 20f224610..d7ad83df7 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -12,13 +12,15 @@ #include "cmOrderDirectories.h" #include "cmAlgorithms.h" +#include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmSystemTools.h" #include "cmake.h" -#include - #include +#include +#include +#include /* Directory ordering computation. diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h index 13823a18b..081e8a09b 100644 --- a/Source/cmOrderDirectories.h +++ b/Source/cmOrderDirectories.h @@ -14,14 +14,16 @@ #include -#include "cmStandardIncludes.h" - #include +#include +#include +#include +#include +#include +class cmGeneratorTarget; class cmGlobalGenerator; class cmOrderDirectoriesConstraint; -class cmOrderDirectoriesConstraintLibrary; -class cmGeneratorTarget; /** \class cmOrderDirectories * \brief Compute a safe runtime path order for a set of shared libraries. diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 630da4234..d44fbb773 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -12,14 +12,14 @@ #include "cmOutputConverter.h" #include "cmAlgorithms.h" -#include "cmake.h" +#include "cmSystemTools.h" +#include #include +#include +#include #include -#include /* isalpha */ -#include /* strlen */ - cmOutputConverter::cmOutputConverter(cmState::Snapshot snapshot) : StateSnapshot(snapshot) , LinkScriptShell(false) diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index 02468c83a..ac58ddc32 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -12,13 +12,13 @@ #ifndef cmOutputConverter_h #define cmOutputConverter_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" - -#include "cmGlobalGenerator.h" #include "cmState.h" +#include +#include + class cmOutputConverter { public: diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index f1da4d5d6..00f13705f 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -13,19 +13,40 @@ #include "cmQtAutoGeneratorInitializer.h" +#include "cmAlgorithms.h" +#include "cmCustomCommandLines.h" #include "cmFilePathUuid.h" +#include "cmGeneratorTarget.h" +#include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmOutputConverter.h" #include "cmSourceFile.h" - -#include - -#include +#include "cmSourceFileLocation.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmake.h" #if defined(_WIN32) && !defined(__CYGWIN__) #include "cmGlobalVisualStudioGenerator.h" #endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + static std::string GetAutogenTargetName(cmGeneratorTarget const* target) { std::string autogenTargetName = target->GetName(); diff --git a/Source/cmQtAutoGeneratorInitializer.h b/Source/cmQtAutoGeneratorInitializer.h index c5a7aba72..fedb38816 100644 --- a/Source/cmQtAutoGeneratorInitializer.h +++ b/Source/cmQtAutoGeneratorInitializer.h @@ -14,15 +14,8 @@ #ifndef cmQtAutoGeneratorInitializer_h #define cmQtAutoGeneratorInitializer_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" - -#include -#include -#include - -class cmSourceFile; class cmGeneratorTarget; class cmLocalGenerator; diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index a261962a2..329c74281 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -20,14 +20,21 @@ #include "cmOutputConverter.h" #include "cmState.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" -#include - +#include #include +#include #include +#include #include - +#include +#include +#include #include +#include + #if defined(__APPLE__) #include #endif diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index ba439d462..32975c2bf 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -14,12 +14,11 @@ #ifndef cmQtAutoGenerators_h #define cmQtAutoGenerators_h -#include - -#include "cmStandardIncludes.h" +#include // IWYU pragma: keep #include #include +#include #include #include diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index 10d1cda22..7f8092379 100644 --- a/Source/cmRST.cxx +++ b/Source/cmRST.cxx @@ -14,8 +14,13 @@ #include "cmAlgorithms.h" #include "cmSystemTools.h" #include "cmVersion.h" + +#include #include #include +#include +#include +#include cmRST::cmRST(std::ostream& os, std::string const& docroot) : OS(os) diff --git a/Source/cmRST.h b/Source/cmRST.h index 895901a7c..f37af8846 100644 --- a/Source/cmRST.h +++ b/Source/cmRST.h @@ -12,11 +12,14 @@ #ifndef _cmRST_h #define _cmRST_h -#include - -#include "cmStandardIncludes.h" +#include // IWYU pragma: keep #include +#include +#include +#include +#include +#include /** \class cmRST * \brief Perform basic .rst processing for command-line help diff --git a/Source/cmScriptGenerator.cxx b/Source/cmScriptGenerator.cxx index a000258dc..1ab70e23f 100644 --- a/Source/cmScriptGenerator.cxx +++ b/Source/cmScriptGenerator.cxx @@ -13,6 +13,8 @@ #include "cmSystemTools.h" +#include + cmScriptGenerator::cmScriptGenerator( const std::string& config_var, std::vector const& configurations) diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h index 4f4dd9ed6..abe9a1d2c 100644 --- a/Source/cmScriptGenerator.h +++ b/Source/cmScriptGenerator.h @@ -12,9 +12,11 @@ #ifndef cmScriptGenerator_h #define cmScriptGenerator_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include +#include +#include class cmScriptGeneratorIndent { diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 5869a01be..3aa4b9232 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -11,11 +11,16 @@ ============================================================================*/ #include "cmSourceFile.h" +#include "cmCustomCommand.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" +#include "cmProperty.h" +#include "cmState.h" #include "cmSystemTools.h" #include "cmake.h" +#include + cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name) : Location(mf, name) { diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index a3808f7ba..2c6d831e9 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -12,12 +12,16 @@ #ifndef cmSourceFile_h #define cmSourceFile_h +#include + +#include "cmPropertyMap.h" #include "cmSourceFileLocation.h" -#include "cmCustomCommand.h" -#include "cmPropertyMap.h" +#include +#include -class cmake; +class cmCustomCommand; +class cmMakefile; /** \class cmSourceFile * \brief Represent a class loaded from a makefile. diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index 099a6f07a..e2a1552e2 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -11,12 +11,17 @@ ============================================================================*/ #include "cmSourceFileLocation.h" +#include + #include "cmAlgorithms.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmSystemTools.h" +#include "cmake.h" -#include "assert.h" +#include +#include +#include cmSourceFileLocation::cmSourceFileLocation() : Makefile(CM_NULLPTR) diff --git a/Source/cmSourceFileLocation.h b/Source/cmSourceFileLocation.h index d41f2bdfb..e4e51161b 100644 --- a/Source/cmSourceFileLocation.h +++ b/Source/cmSourceFileLocation.h @@ -12,9 +12,9 @@ #ifndef cmSourceFileLocation_h #define cmSourceFileLocation_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include class cmMakefile; diff --git a/Source/cmSourceGroup.h b/Source/cmSourceGroup.h index c7f093f20..c5e63110e 100644 --- a/Source/cmSourceGroup.h +++ b/Source/cmSourceGroup.h @@ -14,12 +14,12 @@ #include -#include "cmStandardIncludes.h" - #include +#include +#include +#include class cmSourceFile; - class cmSourceGroupInternals; /** \class cmSourceGroup diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 21a50cba4..be0ee5053 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -12,20 +12,7 @@ #include "cmSystemTools.h" #include "cmAlgorithms.h" -#include -#include -#include -#include -#include -#include -#ifdef __QNX__ -#include /* for malloc/free on QNX */ -#endif -#include -#include -#include -#include -#include + #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmArchiveWrite.h" #include "cmLocale.h" @@ -34,31 +21,6 @@ #define __LA_INT64_T la_int64_t #endif #endif -#include -#include - -#if defined(_WIN32) -#include -// include wincrypt.h after windows.h -#include -#else -#include -#include -#include -#include -#include -#endif - -#if defined(__APPLE__) -#include -#endif - -#include - -#if defined(_WIN32) && \ - (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__MINGW32__)) -#include -#endif #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmCryptoHash.h" @@ -72,6 +34,49 @@ #include "cmMachO.h" #endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#include +// include wincrypt.h after windows.h +#include +#else +#include +#include +#include +#endif + +#if defined(_WIN32) && \ + (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__MINGW32__)) +#include +#endif + +#if defined(__APPLE__) +#include +#endif + +#ifdef __QNX__ +#include /* for malloc/free on QNX */ +#endif + static bool cm_isspace(char c) { return ((c & 0x80) == 0) && isspace(c); @@ -142,6 +147,7 @@ private: }; #elif defined(__APPLE__) #include + #define environ (*_NSGetEnviron()) #endif diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index cfc174e96..090c9d6ef 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -20,6 +20,7 @@ #include "cmState.h" #include "cmSystemTools.h" #include "cmTest.h" +#include "cm_auto_ptr.hxx" #include #include diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 701a5e5e1..25f9e3a78 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -12,33 +12,33 @@ #include "cmake.h" #include "cmAlgorithms.h" -#include "cmCommand.h" #include "cmCommands.h" +#include "cmDocumentation.h" +#include "cmDocumentationEntry.h" #include "cmDocumentationFormatter.h" #include "cmExternalMakefileProjectGenerator.h" #include "cmFileTimeComparison.h" +#include "cmGeneratorTarget.h" +#include "cmGlobalGenerator.h" +#include "cmGlobalGeneratorFactory.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmMessenger.h" -#include "cmSourceFile.h" #include "cmState.h" -#include "cmTest.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmTargetLinkLibraryType.h" #include "cmUtils.hxx" -#include "cmVersionMacros.h" +#include "cmVersionConfig.h" +#include "cm_auto_ptr.hxx" #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmGraphVizWriter.h" #include "cmVariableWatch.h" -#include - -#include "cm_jsoncpp_value.h" -#include "cm_jsoncpp_writer.h" +#include +#include #endif -#include -#include -#include - // only build kdevelop generator on non-windows platforms // when not bootstrapping cmake #if !defined(_WIN32) @@ -69,6 +69,7 @@ #include "cmGlobalVisualStudio71Generator.h" #include "cmGlobalVisualStudio8Generator.h" #include "cmGlobalVisualStudio9Generator.h" + #define CMAKE_HAVE_VS_GENERATORS #endif #include "cmGlobalMSYSMakefileGenerator.h" @@ -98,11 +99,10 @@ #include "cmExtraEclipseCDT4Generator.h" #endif -#include // required for atoi - #if defined(__APPLE__) #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmGlobalXCodeGenerator.h" + #define CMAKE_USE_XCODE 1 #endif #include @@ -113,7 +113,18 @@ // include sys/stat.h after sys/types.h #include // struct stat -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class cmCommand; namespace { diff --git a/Source/cmake.h b/Source/cmake.h index 91a23cdaf..9dc429d78 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -15,25 +15,23 @@ #include -#include "cmStandardIncludes.h" - -#include "cmCacheManager.h" #include "cmInstalledFile.h" #include "cmListFileCache.h" #include "cmState.h" -#include "cmSystemTools.h" -class cmGlobalGeneratorFactory; +#include +#include +#include +#include + +class cmExternalMakefileProjectGeneratorFactory; +class cmFileTimeComparison; class cmGlobalGenerator; -class cmLocalGenerator; +class cmGlobalGeneratorFactory; class cmMakefile; class cmMessenger; class cmVariableWatch; -class cmFileTimeComparison; -class cmExternalMakefileProjectGeneratorFactory; -class cmDocumentationSection; -class cmTarget; -class cmGeneratedFileStream; +struct cmDocumentationEntry; /** \brief Represents a cmake invocation. * diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index db6d51b3a..145094978 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -17,18 +17,23 @@ #endif #include "cmAlgorithms.h" +#include "cmDocumentationEntry.h" #include "cmGlobalGenerator.h" -#include "cmListFileCache.h" -#include "cmLocalGenerator.h" #include "cmMakefile.h" -#include "cmSourceFile.h" #include "cmState.h" +#include "cmSystemTools.h" #include "cmake.h" #include "cmcmd.h" + +#include #include +#include +#include +#include +#include #ifdef CMAKE_USE_LIBUV -#include "cm_uv.h" +#include #endif #ifdef CMAKE_BUILD_WITH_CMAKE diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index f25c085f6..c2e1d53af 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -16,29 +16,37 @@ #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmQtAutoGenerators.h" +#include "cmState.h" +#include "cmSystemTools.h" #include "cmUtils.hxx" #include "cmVersion.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmDependsFortran.h" // For -E cmake_copy_f90_mod callback. #endif -#include -#include -#include -#include +#if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32) +#include "bindexplib.h" +#endif #if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32) && !defined(__CYGWIN__) #include "cmVisualStudioWCEPlatformParser.h" #endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include // required for atoi -#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) -#include "bindexplib.h" -#endif - void CMakeCommandUsage(const char* program) { std::ostringstream errorStream; diff --git a/Source/cmcmd.h b/Source/cmcmd.h index 1096d0ce6..cd6222d2f 100644 --- a/Source/cmcmd.h +++ b/Source/cmcmd.h @@ -13,9 +13,10 @@ #ifndef cmcmd_h #define cmcmd_h -#include +#include // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include +#include class cmcmd { diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 38ff64f23..93a6ebb8d 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -9,16 +9,21 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "cmCTest.h" -#include "cmSystemTools.h" -// Need these for documentation support. -#include "cmDocumentation.h" -#include "cmake.h" +#include #include "CTest/cmCTestLaunch.h" #include "CTest/cmCTestScriptHandler.h" -#include "cmsys/Encoding.hxx" +#include "cmCTest.h" +#include "cmDocumentation.h" +#include "cmSystemTools.h" +#include "cmake.h" + +#include +#include +#include +#include +#include static const char* cmDocumentationName[][2] = { { CM_NULLPTR, " ctest - Testing driver provided by CMake." },