Commit efed6468 authored by Daniel Pfeifer's avatar Daniel Pfeifer Committed by Brad King

fix a load of include-what-you-use violations

parent bd3d0eaf
......@@ -27,6 +27,8 @@
#include <cmsys/Encoding.hxx>
#include <cmsys/SystemTools.hxx>
#include "cmSystemTools.h" // IWYU pragma: keep
static const char* cmDocumentationName[][2] = { { 0,
" cmake-gui - CMake GUI." },
{ 0, 0 } };
......
......@@ -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 "cmCTestStartCommand.h"
#include "cmDynamicLoader.h"
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmState.h"
#include "cmVersionMacros.h"
#include "cmXMLWriter.h"
#include "cmake.h"
#include <cmsys/Base64.h>
#include <cmsys/Directory.hxx>
#include <cmsys/FStream.hxx>
#include <cmsys/SystemInformation.hxx>
#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 "cmSystemTools.h"
#include "cmVersion.h"
#include "cmVersionConfig.h"
#include "cmXMLWriter.h"
#include "cmake.h"
#include <cm_auto_ptr.hxx>
#include <cm_curl.h>
#include <cm_zlib.h>
#include <cmsys/Base64.h>
#include <cmsys/Directory.hxx>
#include <cmsys/FStream.hxx>
#include <cmsys/Glob.hxx>
#include <cmsys/Process.h>
#include <cmsys/RegularExpression.hxx>
#include <cmsys/String.hxx>
#include <cmsys/SystemInformation.hxx>
#include <ctype.h>
#include <float.h>
#include <math.h>
#include <iostream>
#include <map>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <cm_auto_ptr.hxx>
#include <cm_zlib.h>
#include <cmsys/Base64.h>
#include <string.h>
#include <string>
#include <time.h>
#include <utility>
#include <vector>
#if defined(__BEOS__) || defined(__HAIKU__)
#include <be/kernel/OS.h> /* disable_debugger() API. */
......
......@@ -15,18 +15,18 @@
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
#include "cmListFileCache.h"
#include <cmsys/String.hxx>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <time.h>
#include <vector>
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) \
......
......@@ -11,12 +11,18 @@
============================================================================*/
#include "cmCommandArgumentParserHelper.h"
#include <cm_kwiml.h>
#include "cmCommandArgumentLexer.h"
#include "cmMakefile.h"
#include "cmOutputConverter.h"
#include "cmState.h"
#include "cmSystemTools.h"
#include "cmake.h"
#include "cmCommandArgumentLexer.h"
#include <cmConfigure.h>
#include <iostream>
#include <sstream>
#include <string.h>
int cmCommandArgument_yyparse(yyscan_t yyscanner);
//
......
......@@ -12,9 +12,10 @@
#ifndef cmCommandArgumentParserHelper_h
#define cmCommandArgumentParserHelper_h
#include <cmConfigure.h>
#include <cmConfigure.h> // IWYU pragma: keep
#include "cmStandardIncludes.h"
#include <string>
#include <vector>
#define YYSTYPE cmCommandArgumentParserHelper::ParserType
#define YYSTYPE_IS_DECLARED
......
......@@ -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";
......
......@@ -12,8 +12,10 @@
#include "cmCryptoHash.h"
#include "cm_sha2.h"
#include <cmsys/FStream.hxx>
#include <cmsys/MD5.h>
#include <string.h>
CM_AUTO_PTR<cmCryptoHash> cmCryptoHash::New(const char* algo)
{
......
......@@ -14,9 +14,9 @@
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
#include <cm_auto_ptr.hxx>
#include <string>
#include <vector>
/**
* @brief Abstract base class for cryptographic hash generators
......
......@@ -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 =
......
......@@ -14,9 +14,8 @@
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
#include "cm_curl.h"
#include <cm_curl.h>
#include <string>
std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile = CM_NULLPTR);
......
......@@ -13,7 +13,7 @@
#include "cmMakefile.h"
#include <cm_auto_ptr.hxx>
#include <cmConfigure.h>
cmCustomCommand::cmCustomCommand()
: Backtrace()
......
......@@ -12,11 +12,15 @@
#ifndef cmCustomCommand_h
#define cmCustomCommand_h
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
#include <cmConfigure.h> // IWYU pragma: keep
#include "cmCustomCommandLines.h"
#include "cmListFileCache.h"
#include <string>
#include <utility>
#include <vector>
class cmMakefile;
/** \class cmCustomCommand
......
......@@ -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 <cmConfigure.h>
cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
const std::string& config,
......
......@@ -12,13 +12,14 @@
#ifndef cmCustomCommandGenerator_h
#define cmCustomCommandGenerator_h
#include <cmConfigure.h>
#include <cmConfigure.h> // IWYU pragma: keep
#include "cmStandardIncludes.h"
#include <string>
#include <vector>
class cmCustomCommand;
class cmLocalGenerator;
class cmGeneratorExpression;
class cmLocalGenerator;
class cmCustomCommandGenerator
{
......
......@@ -12,6 +12,8 @@
#include "cmDefinitions.h"
#include <assert.h>
#include <set>
#include <utility>
cmDefinitions::Def cmDefinitions::NoDef;
......
......@@ -14,20 +14,21 @@
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
#include "cmLinkedTree.h"
#include <string>
#include <vector>
#if defined(CMAKE_BUILD_WITH_CMAKE)
#ifdef CMake_HAVE_CXX_UNORDERED_MAP
#include <unordered_map>
#else
#include "cmsys/hash_map.hxx"
#endif
#else
#include <map>
#endif
#include <list>
/** \class cmDefinitions
* \brief Store a scope of variable definitions for CMake language.
*
......
......@@ -16,8 +16,11 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmSystemTools.h"
#include <cmsys/FStream.hxx>
#include <sstream>
#include <string.h>
#include <utility>
cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir)
: CompileDirectory()
......
......@@ -14,7 +14,12 @@
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
#include <iosfwd>
#include <map>
#include <set>
#include <stddef.h>
#include <string>
#include <vector>
class cmFileTimeComparison;
class cmLocalGenerator;
......
......@@ -15,10 +15,11 @@
#include "cmFileTimeComparison.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmOutputConverter.h"
#include "cmSystemTools.h"
#include <cmsys/FStream.hxx>
#include <ctype.h> // isspace
#include <cmsys/FStream.hxx>
#include <utility>
#define INCLUDE_REGEX_LINE \
"^[ \t]*#[ \t]*(include|import)[ \t]*[<\"]([^\">]+)([\">])"
......
......@@ -12,10 +12,19 @@
#ifndef cmDependsC_h
#define cmDependsC_h
#include <cmConfigure.h>
#include "cmDepends.h"
#include <cmsys/RegularExpression.hxx>
#include <iosfwd>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
class cmLocalGenerator;
/** \class cmDependsC
* \brief Dependency scanner for C and C++ object files.
......
......@@ -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 <assert.h>
#include <cmsys/FStream.hxx>
#include <iostream>
#include <map>
#include <stdlib.h>
#include <string.h>
#include <utility>
// 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
......
......@@ -12,10 +12,17 @@
#ifndef cmFortran_h
#define cmFortran_h
#include <cmConfigure.h>
#include <iosfwd>
#include <set>
#include <string>
#include <vector>
#include "cmDepends.h"
class cmDependsFortranInternals;
class cmFortranSourceInfo;
class cmLocalGenerator;
/** \class cmDependsFortran
* \brief Dependency scanner for Fortran object files.
......
......@@ -11,7 +11,6 @@
============================================================================*/
#include "cmDependsJava.h"
#include "cmDependsJavaParserHelper.h"
#include "cmSystemTools.h"
cmDependsJava::cmDependsJava()
......
......@@ -12,8 +12,15 @@
#ifndef cmDependsJava_h
#define cmDependsJava_h
#include <cmConfigure.h>
#include "cmDepends.h"
#include <iosfwd>
#include <map>
#include <set>
#include <string>
/** \class cmDependsJava
* \brief Dependency scanner for Java class files.
*/
......
......@@ -11,9 +11,16 @@
============================================================================*/
#include "cmDependsJavaParserHelper.h"
#include <cmConfigure.h>
#include "cmDependsJavaLexer.h"
#include "cmSystemTools.h"
#include <cmsys/FStream.hxx>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int cmDependsJava_yyparse(yyscan_t yyscanner);
......
......@@ -12,9 +12,10 @@
#ifndef cmDependsJavaParserHelper_h
#define cmDependsJavaParserHelper_h
#include <cmConfigure.h>
#include <cmConfigure.h> // IWYU pragma: keep
#include "cmStandardIncludes.h"
#include <string>
#include <vector>
#define YYSTYPE cmDependsJavaParserHelper::ParserType
#define YYSTYPE_IS_DECLARED
......
......@@ -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 <cmsys/Directory.hxx>
#include <algorithm>
#include <cmsys/FStream.hxx>
#include <cmsys/Glob.hxx>
#include <ctype.h>
#include <algorithm>
#include <string.h>
#include <utility>
static const char* cmDocumentationStandardOptions[][2] = {
{ "--help,-help,-usage,-h,-H,/?", "Print usage information and exit." },
......
......@@ -14,15 +14,15 @@
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
#include "cmDocumentationFormatter.h"
#include "cmDocumentationSection.h"
#include "cmake.h"
namespace cmsys {
class Directory;
}
#include <iosfwd>
#include <map>
#include <string>
#include <vector>
class cmDocumentationSection;
struct cmDocumentationEntry;
/** Class to generate documentation. */
class cmDocumentation : public cmDocumentationEnums
......
......@@ -11,8 +11,14 @@
============================================================================*/
#include "cmDocumentationFormatter.h"
#include "cmDocumentationEntry.h"
#include "cmDocumentationSection.h"
#include <ostream>
#include <string.h>
#include <string>
#include <vector>
cmDocumentationFormatter::cmDocumentationFormatter()
: TextWidth(77)
, TextIndent("")
......
......@@ -12,9 +12,9 @@
#ifndef _cmDocumentationFormatter_h
#define _cmDocumentationFormatter_h
#include <cmConfigure.h>
#include <cmConfigure.h> // IWYU pragma: keep
#include "cmStandardIncludes.h"
#include <iosfwd>
/** This is just a helper class to make it build with MSVC 6.0.
Actually the enums and internal classes could directly go into
......
......@@ -12,7 +12,12 @@
#ifndef _cmDocumentationSection_h
#define _cmDocumentationSection_h
#include "cmDocumentationFormatter.h"
#include <cmConfigure.h> // IWYU pragma: keep
#include "cmDocumentationEntry.h"
#include <string>
#include <vector>
// Low-level interface for custom documents:
/** Internal class representing a section of the documentation.
......
......@@ -11,6 +11,13 @@
============================================================================*/
#include "cmDynamicLoader.h"
#include <cmConfigure.h>
#include <cmsys/DynamicLoader.hxx>
#include <map>
#include <string>
#include <utility>
class cmDynamicLoaderCache
{
public:
......
......@@ -17,9 +17,7 @@
#ifndef cmDynamicLoader_h
#define cmDynamicLoader_h
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
#include <cmConfigure.h> // IWYU pragma: keep
#include <cmsys/DynamicLoader.hxx>
......
......@@ -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 <cm_auto_ptr.hxx>
#include <cm_kwiml.h>
#include <cmsys/FStream.hxx>
#include <map>
#include <sstream>
#include <stddef.h>
#include <utility>
#include <vector>
// Include the ELF format information system header.
#if defined(__OpenBSD__)
......
......@@ -12,6 +12,11 @@
#ifndef cmELF_h
#define cmELF_h
#include <cmConfigure.h>
#include <iosfwd>
#include <string>
#if !defined(CMAKE_USE_ELF_PARSER)
#error "This file may be included only if CMAKE_USE_ELF_PARSER is enabled."
#endif
......
......@@ -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 <algorithm>
#include <map>
#include <set>
#include <sstream>
#include <utility>
cmExportBuildFileGenerator::cmExportBuildFileGenerator()
{
......
......@@ -12,10 +12,18 @@
#ifndef cmExportBuildFileGenerator_h
#define cmExportBuildFileGenerator_h
#include <cmConfigure.h>
#include "cmExportFileGenerator.h"
#include "cmListFileCache.h"
#include <iosfwd>
#include <string>
#include <vector>
class cmExportSet;
class cmGeneratorTarget;
class cmGlobalGenerator;
class cmLocalGenerator;
/** \class cmExportBuildFileGenerator
* \brief Generate a file exporting targets from a build tree.
......