From 7b4244aceb44aad117dfaccfb2287fbddbe9eca7 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 25 Nov 2016 22:10:40 +0100 Subject: iwyu: Fix more findings --- Source/CPack/IFW/cmCPackIFWInstaller.cxx | 8 +++--- Source/CPack/cmCPackGenerator.cxx | 16 ++++++------ Source/CPack/cmCPackGenerator.h | 7 +++--- Source/CPack/cmCPackGeneratorFactory.cxx | 12 ++++----- Source/CPack/cmCPackGeneratorFactory.h | 2 +- Source/CPack/cmCPackLog.cxx | 5 ++-- Source/CPack/cmCPackLog.h | 2 +- Source/CPack/cmCPackRPMGenerator.cxx | 11 +++++---- Source/CPack/cmCPackSTGZGenerator.cxx | 8 +++--- Source/CPack/cpack.cxx | 29 +++++++++++----------- Source/CTest/cmCTestGIT.cxx | 13 +++++----- Source/CTest/cmCTestGenericHandler.cxx | 7 +++--- Source/CTest/cmCTestGenericHandler.h | 8 +++--- Source/CTest/cmCTestLaunch.cxx | 18 +++++++------- Source/CTest/cmCTestMemCheckCommand.cxx | 3 +++ Source/CTest/cmCTestRunTest.h | 4 ++- Source/CTest/cmCTestScriptHandler.cxx | 20 +++++++-------- Source/CTest/cmCTestSubmitHandler.cxx | 18 +++++++------- Source/CTest/cmCTestTestHandler.cxx | 30 +++++++++++----------- Source/CTest/cmCTestUploadCommand.cxx | 5 ++-- Source/CTest/cmCTestVC.h | 5 ++-- Source/cmCTest.h | 1 + Source/cmCryptoHash.h | 6 +++-- Source/cmFileCommand.cxx | 41 ++++++++++++++++++++----------- Source/cmProcessOutput.h | 1 + Tests/CMakeLib/testFindPackageCommand.cxx | 6 ++++- Tests/CMakeLib/testSystemTools.cxx | 7 +++++- Tests/CMakeLib/testXMLSafe.cxx | 5 +++- 28 files changed, 170 insertions(+), 128 deletions(-) diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 0098a4b..ba3248f 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackIFWInstaller.h" +#include +#include +#include +#include + #include "CPack/cmCPackGenerator.h" #include "CPack/cmCPackLog.h" #include "cmCPackIFWGenerator.h" @@ -12,9 +17,6 @@ #include "cmXMLParser.h" #include "cmXMLWriter.h" -#include -#include - #ifdef cmCPackLogger #undef cmCPackLogger #endif diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 09b9c0d..3878a32 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -2,24 +2,24 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackGenerator.h" +#include +#include +#include +#include +#include +#include + #include "cmCPackComponentGroup.h" #include "cmCPackLog.h" #include "cmCryptoHash.h" #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" -#include "cmStateTypes.h" +#include "cmStateSnapshot.h" #include "cmXMLSafe.h" #include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include -#include -#include - #if defined(__HAIKU__) #include #include diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index f32dd70..b43bf8a 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -5,14 +5,15 @@ #include -#include "cmCPackComponentGroup.h" -#include "cmSystemTools.h" - #include #include #include #include +#include "cmCPackComponentGroup.h" +#include "cmSystemTools.h" + +class cmCPackGenerator; class cmCPackLog; class cmInstalledFile; class cmMakefile; diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index 2a0e65b..b012f01 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -2,9 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackGeneratorFactory.h" +#include +#include +#include + #include "IFW/cmCPackIFWGenerator.h" +#include "cmAlgorithms.h" #include "cmCPack7zGenerator.h" #include "cmCPackGenerator.h" +#include "cmCPackLog.h" #include "cmCPackNSISGenerator.h" #include "cmCPackSTGZGenerator.h" #include "cmCPackTGZGenerator.h" @@ -36,12 +42,6 @@ #include "WiX/cmCPackWIXGenerator.h" #endif -#include "cmAlgorithms.h" -#include "cmCPackLog.h" - -#include -#include - cmCPackGeneratorFactory::cmCPackGeneratorFactory() { if (cmCPackTGZGenerator::CanGenerate()) { diff --git a/Source/CPack/cmCPackGeneratorFactory.h b/Source/CPack/cmCPackGeneratorFactory.h index 0a98f91..4ee0bc1 100644 --- a/Source/CPack/cmCPackGeneratorFactory.h +++ b/Source/CPack/cmCPackGeneratorFactory.h @@ -3,7 +3,7 @@ #ifndef cmCPackGeneratorFactory_h #define cmCPackGeneratorFactory_h -#include +#include // IWYU pragma: keep #include #include diff --git a/Source/CPack/cmCPackLog.cxx b/Source/CPack/cmCPackLog.cxx index 317f613..7d5c192 100644 --- a/Source/CPack/cmCPackLog.cxx +++ b/Source/CPack/cmCPackLog.cxx @@ -2,11 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackLog.h" +#include +#include + #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" -#include - cmCPackLog::cmCPackLog() { this->Verbose = false; diff --git a/Source/CPack/cmCPackLog.h b/Source/CPack/cmCPackLog.h index 9ffe5c4..419c932 100644 --- a/Source/CPack/cmCPackLog.h +++ b/Source/CPack/cmCPackLog.h @@ -3,7 +3,7 @@ #ifndef cmCPackLog_h #define cmCPackLog_h -#include +#include // IWYU pragma: keep #include #include diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index 9817327..8ec03c2 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -2,17 +2,18 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackRPMGenerator.h" -#include "cmCPackComponentGroup.h" -#include "cmCPackGenerator.h" -#include "cmCPackLog.h" -#include "cmSystemTools.h" - #include +#include #include #include #include #include +#include "cmCPackComponentGroup.h" +#include "cmCPackGenerator.h" +#include "cmCPackLog.h" +#include "cmSystemTools.h" + cmCPackRPMGenerator::cmCPackRPMGenerator() { } diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index 66ba9f6..682394e 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -2,10 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackSTGZGenerator.h" -#include "cmCPackGenerator.h" -#include "cmCPackLog.h" -#include "cmSystemTools.h" - #include #include #include @@ -16,6 +12,10 @@ // include sys/stat.h after sys/types.h #include +#include "cmCPackGenerator.h" +#include "cmCPackLog.h" +#include "cmSystemTools.h" + cmCPackSTGZGenerator::cmCPackSTGZGenerator() { } diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 06472c6..fa526ae 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -2,6 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) +#include +#endif + #include "cmCPackGenerator.h" #include "cmCPackGeneratorFactory.h" #include "cmCPackLog.h" @@ -10,24 +24,11 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" -#include "cmStateTypes.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) -#include -#endif -#include -#include -#include -#include -#include -#include -#include - static const char* cmDocumentationName[][2] = { { CM_NULLPTR, " cpack - Packaging driver provided by CMake." }, { CM_NULLPTR, CM_NULLPTR } diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index 20512ea..d30f6b3 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -2,12 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestGIT.h" -#include "cmAlgorithms.h" -#include "cmCTest.h" -#include "cmCTestVC.h" -#include "cmProcessTools.h" -#include "cmSystemTools.h" - #include #include #include @@ -16,6 +10,13 @@ #include #include +#include "cmAlgorithms.h" +#include "cmCTest.h" +#include "cmCTestVC.h" +#include "cmProcessOutput.h" +#include "cmProcessTools.h" +#include "cmSystemTools.h" + static unsigned int cmCTestGITVersion(unsigned int epic, unsigned int major, unsigned int minor, unsigned int fix) { diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index c093cc6..7638f45 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -2,12 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestGenericHandler.h" -#include "cmCTest.h" -#include "cmSystemTools.h" - +#include #include #include +#include "cmCTest.h" +#include "cmSystemTools.h" + cmCTestGenericHandler::cmCTestGenericHandler() { this->HandlerVerbose = cmSystemTools::OUTPUT_NONE; diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h index 4176eb2..2ebbe70 100644 --- a/Source/CTest/cmCTestGenericHandler.h +++ b/Source/CTest/cmCTestGenericHandler.h @@ -3,16 +3,16 @@ #ifndef cmCTestGenericHandler_h #define cmCTestGenericHandler_h -#include - -#include "cmCTest.h" -#include "cmSystemTools.h" +#include // IWYU pragma: keep #include #include #include #include +#include "cmCTest.h" +#include "cmSystemTools.h" + class cmCTestCommand; class cmGeneratedFileStream; class cmMakefile; diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 43c0fef..03e0319 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -4,24 +4,24 @@ #include +#include +#include +#include +#include +#include +#include + #include "cmCryptoHash.h" #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmProcessOutput.h" -#include "cmStateTypes.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmXMLWriter.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include - #ifdef _WIN32 #include // for _O_BINARY #include // for _setmode diff --git a/Source/CTest/cmCTestMemCheckCommand.cxx b/Source/CTest/cmCTestMemCheckCommand.cxx index 5e4c5ae..fd7c3a9 100644 --- a/Source/CTest/cmCTestMemCheckCommand.cxx +++ b/Source/CTest/cmCTestMemCheckCommand.cxx @@ -2,6 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestMemCheckCommand.h" +#include +#include + #include "cmCTest.h" #include "cmCTestGenericHandler.h" #include "cmCTestMemCheckHandler.h" diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h index a10e271..ee4630a 100644 --- a/Source/CTest/cmCTestRunTest.h +++ b/Source/CTest/cmCTestRunTest.h @@ -5,11 +5,13 @@ #include // IWYU pragma: keep -#include +#include #include #include #include +#include "cmCTestTestHandler.h" + class cmCTest; class cmProcess; diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 08ea4ee..b537242 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -2,6 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestScriptHandler.h" +#include +#include +#include +#include +#include +#include +#include +#include + #include "cmCTest.h" #include "cmCTestBuildCommand.h" #include "cmCTestCommand.h" @@ -23,19 +32,10 @@ #include "cmMakefile.h" #include "cmState.h" #include "cmStateDirectory.h" -#include "cmStateTypes.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include -#include - #ifdef _WIN32 #include #else diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 2b2d207..0f13c1e 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -2,6 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestSubmitHandler.h" +#include +#include +#include +#include +#include +#include +#include + #include "cmCTest.h" #include "cmCTestCurl.h" #include "cmCTestScriptHandler.h" @@ -9,19 +17,11 @@ #include "cmGeneratedFileStream.h" #include "cmProcessOutput.h" #include "cmState.h" -#include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cmThirdParty.h" #include "cmXMLParser.h" #include "cmake.h" -#include -#include -#include -#include -#include -#include -#include - #if defined(CTEST_USE_XMLRPC) #include "cmVersion.h" #include diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 132d049..ab43dbc 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2,21 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestTestHandler.h" -#include "cmCTest.h" -#include "cmCTestBatchTestHandler.h" -#include "cmCTestMultiProcessHandler.h" -#include "cmCommand.h" -#include "cmGeneratedFileStream.h" -#include "cmGlobalGenerator.h" -#include "cmMakefile.h" -#include "cmState.h" -#include "cmStateTypes.h" -#include "cmSystemTools.h" -#include "cmXMLWriter.h" -#include "cm_auto_ptr.hxx" -#include "cm_utf8.h" -#include "cmake.h" - #include #include #include @@ -32,6 +17,21 @@ #include #include +#include "cmCTest.h" +#include "cmCTestBatchTestHandler.h" +#include "cmCTestMultiProcessHandler.h" +#include "cmCommand.h" +#include "cmGeneratedFileStream.h" +#include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmState.h" +#include "cmStateSnapshot.h" +#include "cmSystemTools.h" +#include "cmXMLWriter.h" +#include "cm_auto_ptr.hxx" +#include "cm_utf8.h" +#include "cmake.h" + class cmExecutionStatus; class cmCTestSubdirCommand : public cmCommand diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx index 9266bce..717117a 100644 --- a/Source/CTest/cmCTestUploadCommand.cxx +++ b/Source/CTest/cmCTestUploadCommand.cxx @@ -2,6 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestUploadCommand.h" +#include +#include + #include "cmCTest.h" #include "cmCTestGenericHandler.h" #include "cmCTestUploadHandler.h" @@ -9,8 +12,6 @@ #include "cmSystemTools.h" #include "cmake.h" -#include - cmCTestGenericHandler* cmCTestUploadCommand::InitializeHandler() { cmCTestGenericHandler* handler = diff --git a/Source/CTest/cmCTestVC.h b/Source/CTest/cmCTestVC.h index dd8b973..2681ba0 100644 --- a/Source/CTest/cmCTestVC.h +++ b/Source/CTest/cmCTestVC.h @@ -5,11 +5,12 @@ #include -#include "cmProcessTools.h" - #include #include +#include "cmProcessOutput.h" +#include "cmProcessTools.h" + class cmCTest; class cmXMLWriter; diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 4436327..8db2e5f 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -14,6 +14,7 @@ #include #include +class cmCTest; class cmCTestGenericHandler; class cmCTestStartCommand; class cmGeneratedFileStream; diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h index 26d55b3..0b562da 100644 --- a/Source/cmCryptoHash.h +++ b/Source/cmCryptoHash.h @@ -3,12 +3,14 @@ #ifndef cmCryptoHash_h #define cmCryptoHash_h -#include +#include // IWYU pragma: keep -#include +#include #include #include +#include "cm_auto_ptr.hxx" + /** * @brief Abstract base class for cryptographic hash generators */ diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index c2e37c1..2f6238b 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2,15 +2,39 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFileCommand.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +// include sys/stat.h after sys/types.h +#include + #include "cmAlgorithms.h" +#include "cmCommandArgumentsHelper.h" #include "cmCryptoHash.h" -#include "cmCryptoHash.h" +#include "cmFileLockPool.h" #include "cmFileTimeComparison.h" +#include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" #include "cmHexFileConverter.h" #include "cmInstallType.h" +#include "cmListFileCache.h" #include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmSystemTools.h" #include "cmTimestamp.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" #if defined(CMAKE_BUILD_WITH_CMAKE) @@ -18,20 +42,7 @@ #include "cmFileLockResult.h" #endif -#undef GetCurrentDirectory -#include -#include - -#include -// include sys/stat.h after sys/types.h -#include - -#include -#include -#include -#include -#include -#include +class cmSystemToolsFileTime; // Table of permissions flags. #if defined(_WIN32) && !defined(__CYGWIN__) diff --git a/Source/cmProcessOutput.h b/Source/cmProcessOutput.h index d7a5e98..6a4e7d5 100644 --- a/Source/cmProcessOutput.h +++ b/Source/cmProcessOutput.h @@ -5,6 +5,7 @@ #include // IWYU pragma: keep +#include #include #include diff --git a/Tests/CMakeLib/testFindPackageCommand.cxx b/Tests/CMakeLib/testFindPackageCommand.cxx index 7622756..bfd429f 100644 --- a/Tests/CMakeLib/testFindPackageCommand.cxx +++ b/Tests/CMakeLib/testFindPackageCommand.cxx @@ -1,9 +1,13 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmFindPackageCommand.h" + +#include // IWYU pragma: keep #include #include +#include + +#include "cmFindPackageCommand.h" #define cmPassed(m) std::cout << "Passed: " << (m) << "\n" #define cmFailed(m) \ diff --git a/Tests/CMakeLib/testSystemTools.cxx b/Tests/CMakeLib/testSystemTools.cxx index b16b088..0dfa326 100644 --- a/Tests/CMakeLib/testSystemTools.cxx +++ b/Tests/CMakeLib/testSystemTools.cxx @@ -1,9 +1,14 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmSystemTools.h" + +#include // IWYU pragma: keep #include +#include #include +#include + +#include "cmSystemTools.h" #define cmPassed(m) std::cout << "Passed: " << (m) << "\n" #define cmFailed(m) \ diff --git a/Tests/CMakeLib/testXMLSafe.cxx b/Tests/CMakeLib/testXMLSafe.cxx index 6c59128..fe776c5 100644 --- a/Tests/CMakeLib/testXMLSafe.cxx +++ b/Tests/CMakeLib/testXMLSafe.cxx @@ -1,11 +1,14 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmXMLSafe.h" + +#include #include #include #include +#include "cmXMLSafe.h" + struct test_pair { const char* in; -- cgit v0.12