Commit bfdf1322 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'include-what-you-use'

efed6468 fix a load of include-what-you-use violations
bd3d0eaf cmCTest: don't redefine cout and cerr
3838a0d5 make sure to include cmConfigure.h before cmStandardIncludes.h
54140848 Tests/CMakeLib: include what you use
3f9c4cdf Tests/CMakeLib: use cmsys::ifstream
parents 4da61391 efed6468
......@@ -13,6 +13,8 @@
#ifndef cmWIXRichTextFormatWriter_h
#define cmWIXRichTextFormatWriter_h
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
#include <cmsys/FStream.hxx>
......
......@@ -13,6 +13,8 @@
#ifndef cmCPackComponentGroup_h
#define cmCPackComponentGroup_h
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
class cmCPackComponentGroup;
......
......@@ -12,6 +12,8 @@
#ifndef cmCursesStandardIncludes_h
#define cmCursesStandardIncludes_h
#include <cmConfigure.h>
#include "../cmStandardIncludes.h"
#if defined(__sun__) && defined(__GNUC__)
......
......@@ -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 } };
......
......@@ -13,6 +13,8 @@
#ifndef bindexplib_h
#define bindexplib_h
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
......
......@@ -12,6 +12,8 @@
#ifndef cmAlgorithms_h
#define cmAlgorithms_h
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
inline bool cmHasLiteralPrefixImpl(const std::string& str1, const char* str2,
......
......@@ -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. */
......
......@@ -13,18 +13,20 @@
#ifndef cmCTest_h
#define cmCTest_h
#include "cmStandardIncludes.h"
#include <cmConfigure.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) \
......@@ -43,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.
*
......
......@@ -12,6 +12,8 @@
#ifndef cmCallVisualStudioMacro_h
#define cmCallVisualStudioMacro_h
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
/** \class cmCallVisualStudioMacro
......
......@@ -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,7 +12,10 @@
#ifndef cmCommandArgumentParserHelper_h
#define cmCommandArgumentParserHelper_h
#include "cmStandardIncludes.h"
#include <cmConfigure.h> // IWYU pragma: keep
#include <string>
#include <vector>
#define YYSTYPE cmCommandArgumentParserHelper::ParserType
#define YYSTYPE_IS_DECLARED
......
......@@ -12,6 +12,8 @@
#ifndef cmCommandArgumentsHelper_h
#define cmCommandArgumentsHelper_h
#include <cmConfigure.h>
#include "cmStandardIncludes.h"
class cmCommandArgumentsHelper;
......
......@@ -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,7 +12,7 @@
#ifndef cmConfigure_h
#define cmConfigure_h
#include <cmsys/Configure.hxx>
#include <cmsys/Configure.hxx> // IWYU pragma: keep
#ifdef _MSC_VER
#pragma warning(disable : 4786)
......
......@@ -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)
{
......
......@@ -12,9 +12,11 @@
#ifndef cmCryptoHash_h
#define cmCryptoHash_h
#include "cmStandardIncludes.h"
#include <cmConfigure.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 =
......
......@@ -12,9 +12,10 @@
#ifndef cmCurl_h
#define cmCurl_h
#include "cmStandardIncludes.h"
#include <cmConfigure.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,9 +12,15 @@
#ifndef cmCustomCommand_h
#define cmCustomCommand_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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment