diff options
Diffstat (limited to 'Source')
195 files changed, 1452 insertions, 362 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 09c0acf..cf9dbb8 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -680,6 +680,8 @@ if (WIN32) cmVisualStudioGeneratorOptions.cxx cmVisualStudio10TargetGenerator.h cmVisualStudio10TargetGenerator.cxx + cmVisualStudio10ToolsetOptions.h + cmVisualStudio10ToolsetOptions.cxx cmLocalVisualStudio10Generator.cxx cmLocalVisualStudio10Generator.h cmGlobalVisualStudio10Generator.h diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ea6bdad..69b4afd 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 7) -set(CMake_VERSION_PATCH 20161026) +set(CMake_VERSION_PATCH 20161101) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index b06bd38..06472c6 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -17,6 +17,9 @@ #include <cmsys/CommandLineArguments.hxx> #include <cmsys/Encoding.hxx> +#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) +#include <cmsys/ConsoleBuf.hxx> +#endif #include <iostream> #include <map> #include <sstream> @@ -84,6 +87,11 @@ int cpackDefinitionArgument(const char* argument, const char* cValue, // this is CPack. int main(int argc, char const* const* argv) { +#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) + // Replace streambuf so we can output Unicode to console + cmsys::ConsoleBuf::Manager consoleOut(std::cout); + cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true); +#endif cmsys::Encoding::CommandLineArguments args = cmsys::Encoding::CommandLineArguments::Main(argc, argv); argc = args.argc(); diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index 1ab4ef6..620de31 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -2,11 +2,19 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmAddCustomCommandCommand.h" -#include "cmTarget.h" +#include <sstream> +#include "cmCustomCommand.h" +#include "cmCustomCommandLines.h" +#include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmPolicies.h" #include "cmSourceFile.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmake.h" -#include "cmGlobalGenerator.h" +class cmExecutionStatus; // cmAddCustomCommandCommand bool cmAddCustomCommandCommand::InitialPass( diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h index 643163c..ea92163 100644 --- a/Source/cmAddCustomCommandCommand.h +++ b/Source/cmAddCustomCommandCommand.h @@ -3,8 +3,14 @@ #ifndef cmAddCustomCommandCommand_h #define cmAddCustomCommandCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmAddCustomCommandCommand * \brief cmAddCustomCommandCommand defines a new command (rule) that can * be executed within the build process diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index 9c41dac..4e656aa 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -2,8 +2,18 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmAddCustomTargetCommand.h" +#include <sstream> + +#include "cmCustomCommandLines.h" #include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmake.h" + +class cmExecutionStatus; // cmAddCustomTargetCommand bool cmAddCustomTargetCommand::InitialPass( diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h index 2ad244c..b679247 100644 --- a/Source/cmAddCustomTargetCommand.h +++ b/Source/cmAddCustomTargetCommand.h @@ -3,8 +3,14 @@ #ifndef cmAddCustomTargetCommand_h #define cmAddCustomTargetCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmAddCustomTargetCommand * \brief Command that adds a target to the build system. * diff --git a/Source/cmAddDefinitionsCommand.cxx b/Source/cmAddDefinitionsCommand.cxx index 8d82e71..9e0607c 100644 --- a/Source/cmAddDefinitionsCommand.cxx +++ b/Source/cmAddDefinitionsCommand.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmAddDefinitionsCommand.h" +#include "cmMakefile.h" + +class cmExecutionStatus; + // cmAddDefinitionsCommand bool cmAddDefinitionsCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmAddDefinitionsCommand.h b/Source/cmAddDefinitionsCommand.h index c6b5699..735f8cc 100644 --- a/Source/cmAddDefinitionsCommand.h +++ b/Source/cmAddDefinitionsCommand.h @@ -3,8 +3,14 @@ #ifndef cmAddDefinitionsCommand_h #define cmAddDefinitionsCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmAddDefinitionsCommand * \brief Specify a list of compiler defines * diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx index 0fa8943..e49d5d5 100644 --- a/Source/cmAddDependenciesCommand.cxx +++ b/Source/cmAddDependenciesCommand.cxx @@ -2,7 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmAddDependenciesCommand.h" -#include "cmGlobalGenerator.h" +#include <sstream> + +#include "cmMakefile.h" +#include "cmTarget.h" +#include "cmake.h" + +class cmExecutionStatus; // cmDependenciesCommand bool cmAddDependenciesCommand::InitialPass( diff --git a/Source/cmAddDependenciesCommand.h b/Source/cmAddDependenciesCommand.h index 2c7aa02..8be546c 100644 --- a/Source/cmAddDependenciesCommand.h +++ b/Source/cmAddDependenciesCommand.h @@ -3,8 +3,14 @@ #ifndef cmDependenciessCommand_h #define cmDependenciessCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmAddDependenciesCommand * \brief Add a dependency to a target * diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx index 3d0729b..2a0bb15 100644 --- a/Source/cmAddExecutableCommand.cxx +++ b/Source/cmAddExecutableCommand.cxx @@ -2,7 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmAddExecutableCommand.h" +#include <sstream> + +#include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmStateTypes.h" +#include "cmTarget.h" +#include "cmake.h" + +class cmExecutionStatus; // cmExecutableCommand bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmAddExecutableCommand.h b/Source/cmAddExecutableCommand.h index 03faaf1..62583d8 100644 --- a/Source/cmAddExecutableCommand.h +++ b/Source/cmAddExecutableCommand.h @@ -3,8 +3,14 @@ #ifndef cmExecutablesCommand_h #define cmExecutablesCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmExecutablesCommand * \brief Defines a list of executables to build. * diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 56cf91a..5c9c744 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -2,12 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmAddLibraryCommand.h" +#include <sstream> + +#include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmPolicies.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cmTarget.h" #include "cmake.h" +class cmExecutionStatus; + // cmLibraryCommand bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmAddLibraryCommand.h b/Source/cmAddLibraryCommand.h index d8eba8d..c23b299 100644 --- a/Source/cmAddLibraryCommand.h +++ b/Source/cmAddLibraryCommand.h @@ -3,8 +3,14 @@ #ifndef cmLibrarysCommand_h #define cmLibrarysCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmLibrarysCommand * \brief Defines a list of executables to build. * diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 0ebe35d..34ec0e3 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -2,8 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmAddSubDirectoryCommand.h" +#include <sstream> +#include <string.h> + +#include "cmMakefile.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmAddSubDirectoryCommand bool cmAddSubDirectoryCommand::InitialPass( std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmAddSubDirectoryCommand.h b/Source/cmAddSubDirectoryCommand.h index f300b2e..85305e6 100644 --- a/Source/cmAddSubDirectoryCommand.h +++ b/Source/cmAddSubDirectoryCommand.h @@ -3,8 +3,14 @@ #ifndef cmAddSubDirectoryCommand_h #define cmAddSubDirectoryCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmAddSubDirectoryCommand * \brief Specify a subdirectory to build * diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx index 11342ee..3a3afdb 100644 --- a/Source/cmAddTestCommand.cxx +++ b/Source/cmAddTestCommand.cxx @@ -2,9 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmAddTestCommand.h" -#include "cmTestGenerator.h" +#include <sstream> +#include "cmMakefile.h" #include "cmTest.h" +#include "cmTestGenerator.h" + +class cmExecutionStatus; // cmExecutableCommand bool cmAddTestCommand::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h index 7bbf7cf..07eff68 100644 --- a/Source/cmAddTestCommand.h +++ b/Source/cmAddTestCommand.h @@ -3,8 +3,14 @@ #ifndef cmAddTestCommand_h #define cmAddTestCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmAddTestCommand * \brief Add a test to the lists of tests to run. * diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index 04e1a0b..ecff0c3 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -44,7 +44,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass( // Load all the files in the directory cmsys::Directory dir; - if (dir.Load(tdir.c_str())) { + if (dir.Load(tdir)) { size_t numfiles = dir.GetNumberOfFiles(); for (size_t i = 0; i < numfiles; ++i) { std::string file = dir.GetFile(static_cast<unsigned long>(i)); diff --git a/Source/cmBreakCommand.cxx b/Source/cmBreakCommand.cxx index a5b6e84..9bb6137 100644 --- a/Source/cmBreakCommand.cxx +++ b/Source/cmBreakCommand.cxx @@ -2,7 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmBreakCommand.h" +#include <sstream> + #include "cmExecutionStatus.h" +#include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmake.h" // cmBreakCommand bool cmBreakCommand::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmBreakCommand.h b/Source/cmBreakCommand.h index f1ade9a..5113e18 100644 --- a/Source/cmBreakCommand.h +++ b/Source/cmBreakCommand.h @@ -3,8 +3,14 @@ #ifndef cmBreakCommand_h #define cmBreakCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmBreakCommand * \brief Break from an enclosing foreach or while loop * diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 8aa4102..6836151 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -2,7 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmBuildCommand.h" +#include <sstream> + #include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmStateTypes.h" +#include "cmSystemTools.h" +#include "cmake.h" + +class cmExecutionStatus; bool cmBuildCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) @@ -82,8 +90,7 @@ bool cmBuildCommand::MainSignature(std::vector<std::string> const& args) std::string makecommand = this->Makefile->GetGlobalGenerator()->GenerateCMakeBuildCommand( - target, configuration.c_str(), "", - this->Makefile->IgnoreErrorsCMP0061()); + target, configuration, "", this->Makefile->IgnoreErrorsCMP0061()); this->Makefile->AddDefinition(variable, makecommand.c_str()); diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h index 0dce4e4..62f1fd3 100644 --- a/Source/cmBuildCommand.h +++ b/Source/cmBuildCommand.h @@ -3,8 +3,14 @@ #ifndef cmBuildCommand_h #define cmBuildCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmBuildCommand * \brief build_command command * diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index 3257c93..1e1cd21 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -7,7 +7,7 @@ #include "cmMakefile.h" #include "cmPolicies.h" -#include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" class cmExecutionStatus; diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx index d71172c..655c42a 100644 --- a/Source/cmCMakeMinimumRequired.cxx +++ b/Source/cmCMakeMinimumRequired.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCMakeMinimumRequired.h" +#include "cmMakefile.h" #include "cmSystemTools.h" #include "cmVersion.h" diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx index 67581b6..3ccc815 100644 --- a/Source/cmCMakePolicyCommand.cxx +++ b/Source/cmCMakePolicyCommand.cxx @@ -2,8 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCMakePolicyCommand.h" +#include <sstream> + +#include "cmMakefile.h" +#include "cmPolicies.h" #include "cmState.h" -#include "cmVersion.h" +#include "cmStateTypes.h" +#include "cmake.h" + +class cmExecutionStatus; // cmCMakePolicyCommand bool cmCMakePolicyCommand::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h index 68d9f7b..409fc59 100644 --- a/Source/cmCMakePolicyCommand.h +++ b/Source/cmCMakePolicyCommand.h @@ -3,8 +3,14 @@ #ifndef cmCMakePolicyCommand_h #define cmCMakePolicyCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmCMakePolicyCommand * \brief Set how CMake should handle policies * diff --git a/Source/cmCommand.cxx b/Source/cmCommand.cxx index 3c839de..181b412 100644 --- a/Source/cmCommand.cxx +++ b/Source/cmCommand.cxx @@ -2,6 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCommand.h" +#include "cmMakefile.h" +#include "cmake.h" + +class cmExecutionStatus; +struct cmListFileArgument; + bool cmCommand::InvokeInitialPass(const std::vector<cmListFileArgument>& args, cmExecutionStatus& status) { diff --git a/Source/cmCommand.h b/Source/cmCommand.h index dcfe8da..d9fd5a2 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -3,9 +3,16 @@ #ifndef cmCommand_h #define cmCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommandArgumentsHelper.h" -#include "cmListFileCache.h" -#include "cmMakefile.h" +#include "cmPolicies.h" + +class cmExecutionStatus; +class cmMakefile; +struct cmListFileArgument; /** \class cmCommand * \brief Superclass for all commands in CMake. diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index 0697d4b..103e72c 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -14,11 +14,8 @@ #include "cmBuildCommand.h" #include "cmCMakeMinimumRequired.h" #include "cmCMakePolicyCommand.h" -#include "cmCommandArgumentsHelper.h" -#include "cmConditionEvaluator.h" #include "cmConfigureFileCommand.h" #include "cmContinueCommand.h" -#include "cmCoreTryCompile.h" #include "cmCreateTestSourceList.h" #include "cmDefinePropertyCommand.h" #include "cmElseCommand.h" @@ -31,10 +28,7 @@ #include "cmEndWhileCommand.h" #include "cmExecProgramCommand.h" #include "cmExecuteProcessCommand.h" -#include "cmExpandedCommandArgument.h" #include "cmFileCommand.h" -#include "cmFindBase.h" -#include "cmFindCommon.h" #include "cmFindFileCommand.h" #include "cmFindLibraryCommand.h" #include "cmFindPackageCommand.h" @@ -49,13 +43,11 @@ #include "cmGetSourceFilePropertyCommand.h" #include "cmGetTargetPropertyCommand.h" #include "cmGetTestPropertyCommand.h" -#include "cmHexFileConverter.h" #include "cmIfCommand.h" #include "cmIncludeCommand.h" #include "cmIncludeDirectoryCommand.h" #include "cmIncludeRegularExpressionCommand.h" #include "cmInstallCommand.h" -#include "cmInstallCommandArguments.h" #include "cmInstallFilesCommand.h" #include "cmInstallTargetsCommand.h" #include "cmLinkDirectoriesCommand.h" @@ -67,10 +59,8 @@ #include "cmMessageCommand.h" #include "cmOptionCommand.h" #include "cmParseArgumentsCommand.h" -#include "cmPathLabel.h" #include "cmProjectCommand.h" #include "cmReturnCommand.h" -#include "cmSearchPath.h" #include "cmSeparateArgumentsCommand.h" #include "cmSetCommand.h" #include "cmSetDirectoryPropertiesCommand.h" @@ -82,7 +72,6 @@ #include "cmStringCommand.h" #include "cmSubdirCommand.h" #include "cmTargetLinkLibrariesCommand.h" -#include "cmTimestamp.h" #include "cmTryCompileCommand.h" #include "cmTryRunCommand.h" #include "cmUnsetCommand.h" @@ -113,7 +102,6 @@ #include "cmTargetCompileFeaturesCommand.h" #include "cmTargetCompileOptionsCommand.h" #include "cmTargetIncludeDirectoriesCommand.h" -#include "cmTargetPropCommandBase.h" #include "cmTargetSourcesCommand.h" #include "cmUseMangledMesaCommand.h" #include "cmUtilitySourceCommand.h" diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 7d98e73..71d6c4e 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -3,6 +3,7 @@ #include "cmConditionEvaluator.h" #include "cmAlgorithms.h" +#include "cmMakefile.h" #include "cmOutputConverter.h" #include "cmState.h" #include "cmSystemTools.h" diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h index 306bee4..3c9d2cd 100644 --- a/Source/cmConditionEvaluator.h +++ b/Source/cmConditionEvaluator.h @@ -5,6 +5,8 @@ #include "cmCommand.h" #include "cmExpandedCommandArgument.h" +#include "cmListFileCache.h" +#include "cmake.h" #include <list> diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index 0755dce..b9c7549 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -2,9 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmConfigureFileCommand.h" +#include <sstream> + +#include "cmMakefile.h" #include "cmSystemTools.h" +#include "cmake.h" -#include <cmsys/RegularExpression.hxx> +class cmExecutionStatus; // cmConfigureFileCommand bool cmConfigureFileCommand::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h index 9df4550..e558b85 100644 --- a/Source/cmConfigureFileCommand.h +++ b/Source/cmConfigureFileCommand.h @@ -3,7 +3,14 @@ #ifndef cmConfigureFileCommand_h #define cmConfigureFileCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +#include "cmNewLineStyle.h" + +class cmExecutionStatus; class cmConfigureFileCommand : public cmCommand { diff --git a/Source/cmContinueCommand.cxx b/Source/cmContinueCommand.cxx index dc3e02c..53d035d 100644 --- a/Source/cmContinueCommand.cxx +++ b/Source/cmContinueCommand.cxx @@ -3,7 +3,9 @@ #include "cmContinueCommand.h" #include "cmExecutionStatus.h" +#include "cmMakefile.h" #include "cmSystemTools.h" +#include "cmake.h" // cmContinueCommand bool cmContinueCommand::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmContinueCommand.h b/Source/cmContinueCommand.h index 0c4e650..c5b8919 100644 --- a/Source/cmContinueCommand.h +++ b/Source/cmContinueCommand.h @@ -3,8 +3,14 @@ #ifndef cmContinueCommand_h #define cmContinueCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmContinueCommand * \brief Continue from an enclosing foreach or while loop * diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index c7b6d58..b7d2196 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -5,6 +5,7 @@ #include "cmAlgorithms.h" #include "cmExportTryCompileFileGenerator.h" #include "cmGlobalGenerator.h" +#include "cmMakefile.h" #include "cmOutputConverter.h" #include "cmState.h" #include "cmake.h" @@ -39,7 +40,7 @@ static std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES = int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, bool isTryRun) { - this->BinaryDirectory = argv[1].c_str(); + this->BinaryDirectory = argv[1]; this->OutputFile = ""; // which signature were we called with ? this->SrcFileSignature = true; @@ -148,13 +149,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } } } else if (doing == DoingOutputVariable) { - outputVariable = argv[i].c_str(); + outputVariable = argv[i]; doing = DoingNone; } else if (doing == DoingCopyFile) { - copyFile = argv[i].c_str(); + copyFile = argv[i]; doing = DoingNone; } else if (doing == DoingCopyFileError) { - copyFileError = argv[i].c_str(); + copyFileError = argv[i]; doing = DoingNone; } else if (doing == DoingSources) { sources.push_back(argv[i]); @@ -162,7 +163,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, this->SrcFileSignature = false; projectName = argv[i].c_str(); } else if (i == 4 && !this->SrcFileSignature) { - targetName = argv[i].c_str(); + targetName = argv[i]; } else { std::ostringstream m; m << "try_compile given unknown argument \"" << argv[i] << "\"."; diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h index 5f909dd..0d9bb79 100644 --- a/Source/cmCoreTryCompile.h +++ b/Source/cmCoreTryCompile.h @@ -4,6 +4,7 @@ #define cmCoreTryCompile_h #include "cmCommand.h" +#include "cmStateTypes.h" /** \class cmCoreTryCompile * \brief Base class for cmTryCompileCommand and cmTryRunCommand diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx index b062d4d..14a6c88 100644 --- a/Source/cmCreateTestSourceList.cxx +++ b/Source/cmCreateTestSourceList.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCreateTestSourceList.h" +#include "cmMakefile.h" #include "cmSourceFile.h" #include "cmSystemTools.h" diff --git a/Source/cmDefinePropertyCommand.cxx b/Source/cmDefinePropertyCommand.cxx index af4eff9..9a097f3 100644 --- a/Source/cmDefinePropertyCommand.cxx +++ b/Source/cmDefinePropertyCommand.cxx @@ -2,9 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmDefinePropertyCommand.h" +#include <sstream> + +#include "cmMakefile.h" +#include "cmProperty.h" #include "cmState.h" -#include "cmStateTypes.h" -#include "cmake.h" + +class cmExecutionStatus; bool cmDefinePropertyCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmDefinePropertyCommand.h b/Source/cmDefinePropertyCommand.h index cdfff9f..02e5b88 100644 --- a/Source/cmDefinePropertyCommand.h +++ b/Source/cmDefinePropertyCommand.h @@ -3,8 +3,14 @@ #ifndef cmDefinesPropertyCommand_h #define cmDefinesPropertyCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + class cmDefinePropertyCommand : public cmCommand { public: diff --git a/Source/cmElseCommand.cxx b/Source/cmElseCommand.cxx index 16e53f6..207777e 100644 --- a/Source/cmElseCommand.cxx +++ b/Source/cmElseCommand.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmElseCommand.h" +class cmExecutionStatus; + bool cmElseCommand::InitialPass(std::vector<std::string> const&, cmExecutionStatus&) { diff --git a/Source/cmElseCommand.h b/Source/cmElseCommand.h index 32e04a7..c0162ad 100644 --- a/Source/cmElseCommand.h +++ b/Source/cmElseCommand.h @@ -3,7 +3,13 @@ #ifndef cmElseCommand_h #define cmElseCommand_h -#include "cmIfCommand.h" +#include <cmConfigure.h> +#include <string> +#include <vector> + +#include "cmCommand.h" + +class cmExecutionStatus; /** \class cmElseCommand * \brief ends an if block diff --git a/Source/cmEnableLanguageCommand.cxx b/Source/cmEnableLanguageCommand.cxx index 49fd6fd..c57b7b1 100644 --- a/Source/cmEnableLanguageCommand.cxx +++ b/Source/cmEnableLanguageCommand.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmEnableLanguageCommand.h" +#include "cmMakefile.h" + +class cmExecutionStatus; + // cmEnableLanguageCommand bool cmEnableLanguageCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmEnableLanguageCommand.h b/Source/cmEnableLanguageCommand.h index 34e1d3d..bafb79e 100644 --- a/Source/cmEnableLanguageCommand.h +++ b/Source/cmEnableLanguageCommand.h @@ -3,8 +3,14 @@ #ifndef cmEnableLanguageCommand_h #define cmEnableLanguageCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmEnableLanguageCommand * \brief Specify the name for this build project. * diff --git a/Source/cmEnableTestingCommand.cxx b/Source/cmEnableTestingCommand.cxx index d66c5b3..6a64450 100644 --- a/Source/cmEnableTestingCommand.cxx +++ b/Source/cmEnableTestingCommand.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmEnableTestingCommand.h" +#include "cmMakefile.h" + +class cmExecutionStatus; + // we do this in the final pass so that we now the subdirs have all // been defined bool cmEnableTestingCommand::InitialPass(std::vector<std::string> const&, diff --git a/Source/cmEnableTestingCommand.h b/Source/cmEnableTestingCommand.h index b94967a..67cd237 100644 --- a/Source/cmEnableTestingCommand.h +++ b/Source/cmEnableTestingCommand.h @@ -3,8 +3,14 @@ #ifndef cmEnableTestingCommand_h #define cmEnableTestingCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmEnableTestingCommand * \brief Enable testing for this directory and below. * diff --git a/Source/cmEndForEachCommand.cxx b/Source/cmEndForEachCommand.cxx index 7184bae..fe6a7f3 100644 --- a/Source/cmEndForEachCommand.cxx +++ b/Source/cmEndForEachCommand.cxx @@ -2,6 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmEndForEachCommand.h" +class cmExecutionStatus; +struct cmListFileArgument; + bool cmEndForEachCommand::InvokeInitialPass( std::vector<cmListFileArgument> const&, cmExecutionStatus&) { diff --git a/Source/cmEndForEachCommand.h b/Source/cmEndForEachCommand.h index a146e4d..772a139 100644 --- a/Source/cmEndForEachCommand.h +++ b/Source/cmEndForEachCommand.h @@ -3,8 +3,15 @@ #ifndef cmEndForEachCommand_h #define cmEndForEachCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; +struct cmListFileArgument; + /** \class cmEndForEachCommand * \brief ends an if block * diff --git a/Source/cmEndFunctionCommand.cxx b/Source/cmEndFunctionCommand.cxx index 82344c6..6adb42b 100644 --- a/Source/cmEndFunctionCommand.cxx +++ b/Source/cmEndFunctionCommand.cxx @@ -2,6 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmEndFunctionCommand.h" +class cmExecutionStatus; +struct cmListFileArgument; + bool cmEndFunctionCommand::InvokeInitialPass( std::vector<cmListFileArgument> const&, cmExecutionStatus&) { diff --git a/Source/cmEndFunctionCommand.h b/Source/cmEndFunctionCommand.h index ab174fd..2599637 100644 --- a/Source/cmEndFunctionCommand.h +++ b/Source/cmEndFunctionCommand.h @@ -3,8 +3,15 @@ #ifndef cmEndFunctionCommand_h #define cmEndFunctionCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; +struct cmListFileArgument; + /** \class cmEndFunctionCommand * \brief ends an if block * diff --git a/Source/cmEndIfCommand.cxx b/Source/cmEndIfCommand.cxx index 78a0d0f..50c2b42 100644 --- a/Source/cmEndIfCommand.cxx +++ b/Source/cmEndIfCommand.cxx @@ -3,6 +3,11 @@ #include "cmEndIfCommand.h" #include <stdlib.h> // required for atof + +#include "cmMakefile.h" + +class cmExecutionStatus; + bool cmEndIfCommand::InitialPass(std::vector<std::string> const&, cmExecutionStatus&) { diff --git a/Source/cmEndIfCommand.h b/Source/cmEndIfCommand.h index d068bb4..dfd6049 100644 --- a/Source/cmEndIfCommand.h +++ b/Source/cmEndIfCommand.h @@ -3,7 +3,13 @@ #ifndef cmEndIfCommand_h #define cmEndIfCommand_h -#include "cmIfCommand.h" +#include <cmConfigure.h> +#include <string> +#include <vector> + +#include "cmCommand.h" + +class cmExecutionStatus; /** \class cmEndIfCommand * \brief ends an if block diff --git a/Source/cmEndMacroCommand.cxx b/Source/cmEndMacroCommand.cxx index 189d969..046b0af 100644 --- a/Source/cmEndMacroCommand.cxx +++ b/Source/cmEndMacroCommand.cxx @@ -2,6 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmEndMacroCommand.h" +class cmExecutionStatus; +struct cmListFileArgument; + bool cmEndMacroCommand::InvokeInitialPass( std::vector<cmListFileArgument> const&, cmExecutionStatus&) { diff --git a/Source/cmEndMacroCommand.h b/Source/cmEndMacroCommand.h index 34ae880..3c462d4 100644 --- a/Source/cmEndMacroCommand.h +++ b/Source/cmEndMacroCommand.h @@ -3,8 +3,15 @@ #ifndef cmEndMacroCommand_h #define cmEndMacroCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; +struct cmListFileArgument; + /** \class cmEndMacroCommand * \brief ends an if block * diff --git a/Source/cmEndWhileCommand.cxx b/Source/cmEndWhileCommand.cxx index b635168..5623f33 100644 --- a/Source/cmEndWhileCommand.cxx +++ b/Source/cmEndWhileCommand.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmEndWhileCommand.h" +#include "cmListFileCache.h" + +class cmExecutionStatus; + bool cmEndWhileCommand::InvokeInitialPass( std::vector<cmListFileArgument> const& args, cmExecutionStatus&) { diff --git a/Source/cmEndWhileCommand.h b/Source/cmEndWhileCommand.h index 2366706..d4e97b4 100644 --- a/Source/cmEndWhileCommand.h +++ b/Source/cmEndWhileCommand.h @@ -3,8 +3,15 @@ #ifndef cmEndWhileCommand_h #define cmEndWhileCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; +struct cmListFileArgument; + /** \class cmEndWhileCommand * \brief ends a while loop * diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index a3d6852..df92592 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -2,9 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExecProgramCommand.h" +#include <cmsys/Process.h> +#include <stdio.h> + +#include "cmMakefile.h" #include "cmSystemTools.h" -#include <cmsys/Process.h> +class cmExecutionStatus; // cmExecProgramCommand bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h index a3e96ae..7cdf777 100644 --- a/Source/cmExecProgramCommand.h +++ b/Source/cmExecProgramCommand.h @@ -3,8 +3,14 @@ #ifndef cmExecProgramCommand_h #define cmExecProgramCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmExecProgramCommand * \brief Command that adds a target to the build system. * diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 2bcf244..c8a3a84 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -2,11 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExecuteProcessCommand.h" -#include "cmSystemTools.h" - #include <cmsys/Process.h> - #include <ctype.h> /* isspace */ +#include <sstream> +#include <stdio.h> + +#include "cmMakefile.h" +#include "cmSystemTools.h" + +class cmExecutionStatus; static bool cmExecuteProcessCommandIsWhitespace(char c) { diff --git a/Source/cmExecuteProcessCommand.h b/Source/cmExecuteProcessCommand.h index 2242998..9ce4338 100644 --- a/Source/cmExecuteProcessCommand.h +++ b/Source/cmExecuteProcessCommand.h @@ -3,8 +3,14 @@ #ifndef cmExecuteProcessCommand_h #define cmExecuteProcessCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmExecuteProcessCommand * \brief Command that adds a target to the build system. * diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index c9dac35..8102276 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -12,7 +12,7 @@ #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" -#include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmake.h" diff --git a/Source/cmExportInstallAndroidMKGenerator.cxx b/Source/cmExportInstallAndroidMKGenerator.cxx index f9f5f3a..2069785 100644 --- a/Source/cmExportInstallAndroidMKGenerator.cxx +++ b/Source/cmExportInstallAndroidMKGenerator.cxx @@ -26,7 +26,7 @@ void cmExportInstallAndroidMKGenerator::GenerateImportHeaderCode( std::string installDir = this->IEGen->GetDestination(); os << "LOCAL_PATH := $(call my-dir)\n"; size_t numDotDot = cmSystemTools::CountChar(installDir.c_str(), '/'); - numDotDot += (installDir.size() > 0) ? 1 : 0; + numDotDot += installDir.empty() ? 0 : 1; std::string path; for (size_t n = 0; n < numDotDot; n++) { path += "/.."; diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index bf1ea01..f556a8b 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -2,17 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExportLibraryDependenciesCommand.h" -#include <cm_auto_ptr.hxx> #include <cmsys/FStream.hxx> +#include <map> +#include <utility> #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmPolicies.h" -#include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetLinkLibraryType.h" +#include "cm_auto_ptr.hxx" +#include "cm_unordered_map.hxx" #include "cmake.h" class cmExecutionStatus; diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index 1f0ce8d..1e8ca06 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -82,8 +82,8 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector<std::string> const& args, no_working_dir); cmSourceFile* sf = this->Makefile->GetSource(cxxres); - sf->AddDepend(hname.c_str()); - sf->AddDepend(origname.c_str()); + sf->AddDepend(hname); + sf->AddDepend(origname); this->GeneratedSourcesClasses.push_back(sf); } } diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 6b5870b..ac76191 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -9,9 +9,9 @@ #include "cmGlobalGenerator.h" #include "cmHexFileConverter.h" #include "cmInstallType.h" -#include "cmake.h" - +#include "cmMakefile.h" #include "cmTimestamp.h" +#include "cmake.h" #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmCurl.h" @@ -2600,7 +2600,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args) // Do not return error for compatibility reason. std::string err = "Unexpected argument: "; err += *i; - this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, err.c_str()); + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, err); } ++i; } @@ -2884,7 +2884,7 @@ bool cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args) // Do not return error for compatibility reason. std::string err = "Unexpected argument: "; err += *i; - this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, err.c_str()); + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, err); } ++i; diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index b53bae8..319864c 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -3,9 +3,13 @@ #ifndef cmFileCommand_h #define cmFileCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" -struct cmFileInstaller; +class cmExecutionStatus; /** \class cmFileCommand * \brief Command for manipulation of files diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx index b55341b..9844306 100644 --- a/Source/cmFileMonitor.cxx +++ b/Source/cmFileMonitor.cxx @@ -247,7 +247,10 @@ public: void StopWatching() final {} - void AppendCallback(cmFileMonitor::Callback cb) { CbList.push_back(cb); } + void AppendCallback(cmFileMonitor::Callback const& cb) + { + this->CbList.push_back(cb); + } std::string Path() const final { @@ -310,7 +313,7 @@ cmFileMonitor::~cmFileMonitor() } void cmFileMonitor::MonitorPaths(const std::vector<std::string>& paths, - Callback cb) + Callback const& cb) { for (const auto& p : paths) { std::vector<std::string> pathSegments; diff --git a/Source/cmFileMonitor.h b/Source/cmFileMonitor.h index e05f48d..48169b8 100644 --- a/Source/cmFileMonitor.h +++ b/Source/cmFileMonitor.h @@ -17,7 +17,7 @@ public: ~cmFileMonitor(); using Callback = std::function<void(const std::string&, int, int)>; - void MonitorPaths(const std::vector<std::string>& paths, Callback cb); + void MonitorPaths(const std::vector<std::string>& paths, Callback const& cb); void StopMonitoring(); std::vector<std::string> WatchedFiles() const; diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 118c581..3d67ac1 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -3,6 +3,7 @@ #include "cmFindBase.h" #include "cmAlgorithms.h" +#include "cmMakefile.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmSystemTools.h" diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index bc175ff..75d1453 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindCommon.h" +#include "cmMakefile.h" #include "cmSystemTools.h" #include <algorithm> diff --git a/Source/cmFindFileCommand.cxx b/Source/cmFindFileCommand.cxx index 9c66cd2..9840c4f 100644 --- a/Source/cmFindFileCommand.cxx +++ b/Source/cmFindFileCommand.cxx @@ -2,8 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindFileCommand.h" -#include "cmSystemTools.h" - cmFindFileCommand::cmFindFileCommand() { this->IncludeFileInPath = true; diff --git a/Source/cmFindFileCommand.h b/Source/cmFindFileCommand.h index e121784..5c94ebf 100644 --- a/Source/cmFindFileCommand.h +++ b/Source/cmFindFileCommand.h @@ -3,8 +3,13 @@ #ifndef cmFindFileCommand_h #define cmFindFileCommand_h +#include <cmConfigure.h> +#include <string> + #include "cmFindPathCommand.h" +class cmCommand; + /** \class cmFindFileCommand * \brief Define a command to search for an executable program. * diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 56be0cb..2feedf3 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -2,12 +2,19 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindLibraryCommand.h" +#include <algorithm> +#include <cmsys/RegularExpression.hxx> +#include <set> +#include <stdio.h> +#include <string.h> + #include "cmGlobalGenerator.h" +#include "cmMakefile.h" #include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" -#include "cmVersion.h" -#include <cmsys/Directory.hxx> +class cmExecutionStatus; cmFindLibraryCommand::cmFindLibraryCommand() { diff --git a/Source/cmFindLibraryCommand.h b/Source/cmFindLibraryCommand.h index 8531e51..aeff629 100644 --- a/Source/cmFindLibraryCommand.h +++ b/Source/cmFindLibraryCommand.h @@ -3,8 +3,15 @@ #ifndef cmFindLibraryCommand_h #define cmFindLibraryCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmFindBase.h" +class cmCommand; +class cmExecutionStatus; + /** \class cmFindLibraryCommand * \brief Define a command to search for a library. * diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 373b728..60de74f 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -2,26 +2,38 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindPackageCommand.h" -#include "cmAlgorithms.h" -#include "cmState.h" -#include "cmVersion.h" - +#include <algorithm> +#include <assert.h> #include <cmSystemTools.h> #include <cmsys/Directory.hxx> -#include <cmsys/Encoding.hxx> #include <cmsys/FStream.hxx> +#include <cmsys/Glob.hxx> #include <cmsys/RegularExpression.hxx> +#include <cmsys/String.h> +#include <functional> +#include <iterator> +#include <sstream> +#include <stdio.h> +#include <string.h> +#include <utility> -#ifdef CMAKE_BUILD_WITH_CMAKE -#include "cmVariableWatch.h" -#endif +#include "cmAlgorithms.h" +#include "cmMakefile.h" +#include "cmSearchPath.h" +#include "cmState.h" +#include "cmStateTypes.h" +#include "cmVersion.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" #if defined(__HAIKU__) #include <FindDirectory.h> #include <StorageDefs.h> -#include <string.h> #endif +class cmExecutionStatus; +class cmFileList; + cmFindPackageCommand::PathLabel cmFindPackageCommand::PathLabel::UserRegistry( "PACKAGE_REGISTRY"); cmFindPackageCommand::PathLabel cmFindPackageCommand::PathLabel::Builds( @@ -1549,11 +1561,6 @@ void cmFindPackageCommand::StoreVersionFound() this->Makefile->AddDefinition(ver + "_COUNT", buf); } -#include <cm_auto_ptr.hxx> -#include <cmsys/Glob.hxx> -#include <cmsys/String.h> - -class cmFileList; class cmFileListGeneratorBase { public: diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index 101749e..d454892 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -3,9 +3,18 @@ #ifndef cmFindPackageCommand_h #define cmFindPackageCommand_h +#include <cmConfigure.h> +#include <cm_kwiml.h> +#include <map> +#include <set> +#include <string> +#include <vector> + #include "cmFindCommon.h" -class cmFindPackageFileList; +class cmCommand; +class cmExecutionStatus; +class cmSearchPath; /** \class cmFindPackageCommand * \brief Load settings from an external project. diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 66dc5d7..0900f46 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -2,9 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindPathCommand.h" +#include <cmsys/Glob.hxx> + +#include "cmMakefile.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" -#include <cmsys/Glob.hxx> +class cmExecutionStatus; cmFindPathCommand::cmFindPathCommand() { diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h index 4ba67ed..edeeb3a 100644 --- a/Source/cmFindPathCommand.h +++ b/Source/cmFindPathCommand.h @@ -3,8 +3,15 @@ #ifndef cmFindPathCommand_h #define cmFindPathCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmFindBase.h" +class cmCommand; +class cmExecutionStatus; + /** \class cmFindPathCommand * \brief Define a command to search for a library. * diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index d258c3c..2c496ba 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -2,9 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindProgramCommand.h" +#include "cmMakefile.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" -#include <stdlib.h> +class cmExecutionStatus; #if defined(__APPLE__) #include <CoreFoundation/CoreFoundation.h> diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h index 4326124..dc17803 100644 --- a/Source/cmFindProgramCommand.h +++ b/Source/cmFindProgramCommand.h @@ -3,8 +3,15 @@ #ifndef cmFindProgramCommand_h #define cmFindProgramCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmFindBase.h" +class cmCommand; +class cmExecutionStatus; + /** \class cmFindProgramCommand * \brief Define a command to search for an executable program. * diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 6fbc93d..6273f6e 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -2,9 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmForEachCommand.h" -#include "cmSystemTools.h" +#include <sstream> +#include <stdio.h> +#include <stdlib.h> -#include <cm_auto_ptr.hxx> +#include "cmExecutionStatus.h" +#include "cmMakefile.h" +#include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" cmForEachFunctionBlocker::cmForEachFunctionBlocker(cmMakefile* mf) : Makefile(mf) diff --git a/Source/cmForEachCommand.h b/Source/cmForEachCommand.h index 9ba4af0..93c4676 100644 --- a/Source/cmForEachCommand.h +++ b/Source/cmForEachCommand.h @@ -3,11 +3,17 @@ #ifndef cmForEachCommand_h #define cmForEachCommand_h -#include "cmCommand.h" +#include <cmConfigure.h> +#include <string> +#include <vector> +#include "cmCommand.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" +class cmExecutionStatus; +class cmMakefile; + class cmForEachFunctionBlocker : public cmFunctionBlocker { public: diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index e9d4496..0ba575a 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -2,9 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFunctionCommand.h" +#include <algorithm> +#include <sstream> + +#include "cmAlgorithms.h" +#include "cmExecutionStatus.h" +#include "cmMakefile.h" +#include "cmPolicies.h" #include "cmState.h" #include "cmSystemTools.h" -#include "cmake.h" // define the class for function commands class cmFunctionHelperCommand : public cmCommand diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h index 7d868b2..afea6f9 100644 --- a/Source/cmFunctionCommand.h +++ b/Source/cmFunctionCommand.h @@ -3,9 +3,16 @@ #ifndef cmFunctionCommand_h #define cmFunctionCommand_h -#include "cmCommand.h" +#include <cmConfigure.h> +#include <string> +#include <vector> +#include "cmCommand.h" #include "cmFunctionBlocker.h" +#include "cmListFileCache.h" + +class cmExecutionStatus; +class cmMakefile; class cmFunctionFunctionBlocker : public cmFunctionBlocker { diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index 01b41e8..c92ae21 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -2,11 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGetCMakePropertyCommand.h" +#include <algorithm> +#include <set> + #include "cmAlgorithms.h" #include "cmGlobalGenerator.h" +#include "cmMakefile.h" #include "cmState.h" -#include "cmStateTypes.h" -#include "cmake.h" + +class cmExecutionStatus; // cmGetCMakePropertyCommand bool cmGetCMakePropertyCommand::InitialPass( diff --git a/Source/cmGetCMakePropertyCommand.h b/Source/cmGetCMakePropertyCommand.h index 30bc2d8..41a51a4 100644 --- a/Source/cmGetCMakePropertyCommand.h +++ b/Source/cmGetCMakePropertyCommand.h @@ -3,8 +3,14 @@ #ifndef cmGetCMakePropertyCommand_h #define cmGetCMakePropertyCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + class cmGetCMakePropertyCommand : public cmCommand { public: diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx index 0670d31..920e1a0 100644 --- a/Source/cmGetDirectoryPropertyCommand.cxx +++ b/Source/cmGetDirectoryPropertyCommand.cxx @@ -3,9 +3,13 @@ #include "cmGetDirectoryPropertyCommand.h" #include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmPolicies.h" #include "cmSystemTools.h" #include "cmake.h" +class cmExecutionStatus; + // cmGetDirectoryPropertyCommand bool cmGetDirectoryPropertyCommand::InitialPass( std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmGetDirectoryPropertyCommand.h b/Source/cmGetDirectoryPropertyCommand.h index 625adb0..1ae3125 100644 --- a/Source/cmGetDirectoryPropertyCommand.h +++ b/Source/cmGetDirectoryPropertyCommand.h @@ -3,8 +3,14 @@ #ifndef cmGetDirectoryPropertyCommand_h #define cmGetDirectoryPropertyCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + class cmGetDirectoryPropertyCommand : public cmCommand { public: diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index c183947..5915a67 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -2,8 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGetFilenameComponentCommand.h" +#include "cmMakefile.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmGetFilenameComponentCommand bool cmGetFilenameComponentCommand::InitialPass( std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h index 68bf31f..c0ad903 100644 --- a/Source/cmGetFilenameComponentCommand.h +++ b/Source/cmGetFilenameComponentCommand.h @@ -3,8 +3,14 @@ #ifndef cmGetFilenameComponentCommand_h #define cmGetFilenameComponentCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmGetFilenameComponentCommand * \brief Get a specific component of a filename. * diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 1852eab..d2056d2 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -2,15 +2,26 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGetPropertyCommand.h" +#include <sstream> + #include "cmGlobalGenerator.h" +#include "cmInstalledFile.h" +#include "cmListFileCache.h" +#include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmProperty.h" #include "cmPropertyDefinition.h" #include "cmSourceFile.h" #include "cmState.h" -#include "cmStateTypes.h" +#include "cmSystemTools.h" +#include "cmTarget.h" #include "cmTargetPropertyComputer.h" #include "cmTest.h" #include "cmake.h" +class cmExecutionStatus; +class cmMessenger; + cmGetPropertyCommand::cmGetPropertyCommand() { this->InfoType = OutValue; diff --git a/Source/cmGetPropertyCommand.h b/Source/cmGetPropertyCommand.h index 20268b4..f9a33ac 100644 --- a/Source/cmGetPropertyCommand.h +++ b/Source/cmGetPropertyCommand.h @@ -3,8 +3,14 @@ #ifndef cmGetPropertyCommand_h #define cmGetPropertyCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + class cmGetPropertyCommand : public cmCommand { public: diff --git a/Source/cmGetSourceFilePropertyCommand.cxx b/Source/cmGetSourceFilePropertyCommand.cxx index 43f9256..509ef95 100644 --- a/Source/cmGetSourceFilePropertyCommand.cxx +++ b/Source/cmGetSourceFilePropertyCommand.cxx @@ -2,8 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGetSourceFilePropertyCommand.h" +#include "cmMakefile.h" #include "cmSourceFile.h" +class cmExecutionStatus; + // cmSetSourceFilePropertyCommand bool cmGetSourceFilePropertyCommand::InitialPass( std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmGetSourceFilePropertyCommand.h b/Source/cmGetSourceFilePropertyCommand.h index 1edc392..0f71851 100644 --- a/Source/cmGetSourceFilePropertyCommand.h +++ b/Source/cmGetSourceFilePropertyCommand.h @@ -3,8 +3,14 @@ #ifndef cmGetSourceFilePropertyCommand_h #define cmGetSourceFilePropertyCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + class cmGetSourceFilePropertyCommand : public cmCommand { public: diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index e78f780..2379292 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -2,7 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGetTargetPropertyCommand.h" +#include <sstream> + +#include "cmListFileCache.h" +#include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmTarget.h" #include "cmTargetPropertyComputer.h" +#include "cmake.h" + +class cmExecutionStatus; +class cmMessenger; // cmSetTargetPropertyCommand bool cmGetTargetPropertyCommand::InitialPass( diff --git a/Source/cmGetTargetPropertyCommand.h b/Source/cmGetTargetPropertyCommand.h index f36cc48..32fe803 100644 --- a/Source/cmGetTargetPropertyCommand.h +++ b/Source/cmGetTargetPropertyCommand.h @@ -3,8 +3,14 @@ #ifndef cmGetTargetPropertyCommand_h #define cmGetTargetPropertyCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + class cmGetTargetPropertyCommand : public cmCommand { public: diff --git a/Source/cmGetTestPropertyCommand.cxx b/Source/cmGetTestPropertyCommand.cxx index 4a445dc..a8a44b7 100644 --- a/Source/cmGetTestPropertyCommand.cxx +++ b/Source/cmGetTestPropertyCommand.cxx @@ -2,8 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGetTestPropertyCommand.h" +#include "cmMakefile.h" #include "cmTest.h" -#include "cmake.h" + +class cmExecutionStatus; // cmGetTestPropertyCommand bool cmGetTestPropertyCommand::InitialPass( diff --git a/Source/cmGetTestPropertyCommand.h b/Source/cmGetTestPropertyCommand.h index 5dc89bd..0491cc8 100644 --- a/Source/cmGetTestPropertyCommand.h +++ b/Source/cmGetTestPropertyCommand.h @@ -3,8 +3,14 @@ #ifndef cmGetTestPropertyCommand_h #define cmGetTestPropertyCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + class cmGetTestPropertyCommand : public cmCommand { public: diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index ee594b0..830ab7f 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -34,6 +34,11 @@ const char* cmGlobalNinjaGenerator::NINJA_BUILD_FILE = "build.ninja"; const char* cmGlobalNinjaGenerator::NINJA_RULES_FILE = "rules.ninja"; const char* cmGlobalNinjaGenerator::INDENT = " "; +#ifdef _WIN32 +std::string const cmGlobalNinjaGenerator::SHELL_NOOP = "cd ."; +#else +std::string const cmGlobalNinjaGenerator::SHELL_NOOP = ":"; +#endif void cmGlobalNinjaGenerator::Indent(std::ostream& os, int count) { diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 81ec3eb..064ff0b 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -58,6 +58,9 @@ public: /// The indentation string used when generating Ninja's build file. static const char* INDENT; + /// The shell command used for a no-op. + static std::string const SHELL_NOOP; + /// Write @a count times INDENT level to output stream @a os. static void Indent(std::ostream& os, int count); diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 17d49e8..90caaf9 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -963,7 +963,7 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule( (type == cmStateEnums::OBJECT_LIBRARY) || (type == cmStateEnums::GLOBAL_TARGET) || (type == cmStateEnums::UTILITY)) { - std::string name = target->GetName(); + std::string const& name = target->GetName(); if (emittedTargets.insert(name).second) { path = "... "; path += name; diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 7af971e..2ce65cd 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -9,6 +9,11 @@ #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" #include "cmSourceFile.h" +#include "cmVS10CLFlagTable.h" +#include "cmVS10LibFlagTable.h" +#include "cmVS10LinkFlagTable.h" +#include "cmVS10MASMFlagTable.h" +#include "cmVS10RCFlagTable.h" #include "cmVisualStudioSlnData.h" #include "cmVisualStudioSlnParser.h" #include "cmake.h" @@ -94,6 +99,11 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator( this->SystemIsWindowsStore = false; this->MSBuildCommandInitialized = false; this->DefaultPlatformToolset = "v100"; + this->DefaultClFlagTable = cmVS10CLFlagTable; + this->DefaultLibFlagTable = cmVS10LibFlagTable; + this->DefaultLinkFlagTable = cmVS10LinkFlagTable; + this->DefaultMasmFlagTable = cmVS10MASMFlagTable; + this->DefaultRcFlagTable = cmVS10RCFlagTable; this->Version = VS10; } @@ -339,13 +349,24 @@ void cmGlobalVisualStudio10Generator::EnableLanguage( const char* cmGlobalVisualStudio10Generator::GetPlatformToolset() const { + std::string const& toolset = this->GetPlatformToolsetString(); + if (toolset.empty()) { + return CM_NULLPTR; + } + return toolset.c_str(); +} + +std::string const& cmGlobalVisualStudio10Generator::GetPlatformToolsetString() + const +{ if (!this->GeneratorToolset.empty()) { - return this->GeneratorToolset.c_str(); + return this->GeneratorToolset; } if (!this->DefaultPlatformToolset.empty()) { - return this->DefaultPlatformToolset.c_str(); + return this->DefaultPlatformToolset; } - return 0; + static std::string const empty; + return empty; } const char* @@ -597,3 +618,43 @@ std::string cmGlobalVisualStudio10Generator::GetInstalledNsightTegraVersion() version, cmSystemTools::KeyWOW64_32); return version; } + +cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetClFlagTable() const +{ + cmIDEFlagTable const* table = this->ToolsetOptions.GetClFlagTable( + this->GetPlatformName(), this->GetPlatformToolsetString()); + + return (table != CM_NULLPTR) ? table : this->DefaultClFlagTable; +} + +cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetRcFlagTable() const +{ + cmIDEFlagTable const* table = this->ToolsetOptions.GetRcFlagTable( + this->GetPlatformName(), this->GetPlatformToolsetString()); + + return (table != CM_NULLPTR) ? table : this->DefaultRcFlagTable; +} + +cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLibFlagTable() const +{ + cmIDEFlagTable const* table = this->ToolsetOptions.GetLibFlagTable( + this->GetPlatformName(), this->GetPlatformToolsetString()); + + return (table != CM_NULLPTR) ? table : this->DefaultLibFlagTable; +} + +cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLinkFlagTable() const +{ + cmIDEFlagTable const* table = this->ToolsetOptions.GetLinkFlagTable( + this->GetPlatformName(), this->GetPlatformToolsetString()); + + return (table != CM_NULLPTR) ? table : this->DefaultLinkFlagTable; +} + +cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetMasmFlagTable() const +{ + cmIDEFlagTable const* table = this->ToolsetOptions.GetMasmFlagTable( + this->GetPlatformName(), this->GetPlatformToolsetString()); + + return (table != CM_NULLPTR) ? table : this->DefaultMasmFlagTable; +} diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 62b8661..4175104 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -4,6 +4,7 @@ #define cmGlobalVisualStudio10Generator_h #include "cmGlobalVisualStudio8Generator.h" +#include "cmVisualStudio10ToolsetOptions.h" /** \class cmGlobalVisualStudio10Generator * \brief Write a Unix makefiles. @@ -48,6 +49,7 @@ public: /** The toolset name for the target platform. */ const char* GetPlatformToolset() const; + std::string const& GetPlatformToolsetString() const; /** The toolset host architecture name (e.g. x64 for 64-bit host tools). */ const char* GetPlatformToolsetHostArchitecture() const; @@ -88,6 +90,12 @@ public: static std::string GetInstalledNsightTegraVersion(); + cmIDEFlagTable const* GetClFlagTable() const; + cmIDEFlagTable const* GetRcFlagTable() const; + cmIDEFlagTable const* GetLibFlagTable() const; + cmIDEFlagTable const* GetLinkFlagTable() const; + cmIDEFlagTable const* GetMasmFlagTable() const; + protected: virtual void Generate(); virtual bool InitializeSystem(cmMakefile* mf); @@ -111,6 +119,11 @@ protected: std::string SystemName; std::string SystemVersion; std::string NsightTegraVersion; + cmIDEFlagTable const* DefaultClFlagTable; + cmIDEFlagTable const* DefaultLibFlagTable; + cmIDEFlagTable const* DefaultLinkFlagTable; + cmIDEFlagTable const* DefaultMasmFlagTable; + cmIDEFlagTable const* DefaultRcFlagTable; bool SystemIsWindowsCE; bool SystemIsWindowsPhone; bool SystemIsWindowsStore; @@ -134,6 +147,7 @@ private: std::string MSBuildCommand; bool MSBuildCommandInitialized; + cmVisualStudio10ToolsetOptions ToolsetOptions; virtual std::string FindMSBuildCommand(); virtual std::string FindDevEnvCommand(); virtual std::string GetVSMakeProgram() { return this->GetMSBuildCommand(); } diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index f120762..acd2c2b 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -5,6 +5,11 @@ #include "cmAlgorithms.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" +#include "cmVS11CLFlagTable.h" +#include "cmVS11LibFlagTable.h" +#include "cmVS11LinkFlagTable.h" +#include "cmVS11MASMFlagTable.h" +#include "cmVS11RCFlagTable.h" static const char vs11generatorName[] = "Visual Studio 11 2012"; @@ -101,6 +106,11 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator( "ProductDir", vc11Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v110"; + this->DefaultClFlagTable = cmVS11CLFlagTable; + this->DefaultLibFlagTable = cmVS11LibFlagTable; + this->DefaultLinkFlagTable = cmVS11LinkFlagTable; + this->DefaultMasmFlagTable = cmVS11MASMFlagTable; + this->DefaultRcFlagTable = cmVS11RCFlagTable; this->Version = VS11; } diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index ec7916c..c18ff9e 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -5,6 +5,11 @@ #include "cmAlgorithms.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" +#include "cmVS12CLFlagTable.h" +#include "cmVS12LibFlagTable.h" +#include "cmVS12LinkFlagTable.h" +#include "cmVS12MASMFlagTable.h" +#include "cmVS12RCFlagTable.h" static const char vs12generatorName[] = "Visual Studio 12 2013"; @@ -83,6 +88,11 @@ cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator( "ProductDir", vc12Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v120"; + this->DefaultClFlagTable = cmVS12CLFlagTable; + this->DefaultLibFlagTable = cmVS12LibFlagTable; + this->DefaultLinkFlagTable = cmVS12LinkFlagTable; + this->DefaultMasmFlagTable = cmVS12MASMFlagTable; + this->DefaultRcFlagTable = cmVS12RCFlagTable; this->Version = VS12; } diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index 586fe3c..e0b86d7 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -5,6 +5,11 @@ #include "cmAlgorithms.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" +#include "cmVS140CLFlagTable.h" +#include "cmVS14LibFlagTable.h" +#include "cmVS14LinkFlagTable.h" +#include "cmVS14MASMFlagTable.h" +#include "cmVS14RCFlagTable.h" static const char vs14generatorName[] = "Visual Studio 14 2015"; @@ -83,6 +88,11 @@ cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator( "ProductDir", vc14Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v140"; + this->DefaultClFlagTable = cmVS140CLFlagTable; + this->DefaultLibFlagTable = cmVS14LibFlagTable; + this->DefaultLinkFlagTable = cmVS14LinkFlagTable; + this->DefaultMasmFlagTable = cmVS14MASMFlagTable; + this->DefaultRcFlagTable = cmVS14RCFlagTable; this->Version = VS14; } diff --git a/Source/cmGlobalVisualStudio15Generator.cxx b/Source/cmGlobalVisualStudio15Generator.cxx index a833a5f..fbc7a10 100644 --- a/Source/cmGlobalVisualStudio15Generator.cxx +++ b/Source/cmGlobalVisualStudio15Generator.cxx @@ -5,6 +5,7 @@ #include "cmAlgorithms.h" #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" +#include "cmVS141CLFlagTable.h" static const char vs15generatorName[] = "Visual Studio 15"; @@ -80,6 +81,7 @@ cmGlobalVisualStudio15Generator::cmGlobalVisualStudio15Generator( "ProductDir", vc15Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v141"; + this->DefaultClFlagTable = cmVS141CLFlagTable; this->Version = VS15; } diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index eb85b16..a8fa4f9 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -2,15 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmIfCommand.h" +#include "cmConditionEvaluator.h" +#include "cmExecutionStatus.h" +#include "cmExpandedCommandArgument.h" +#include "cmMakefile.h" #include "cmOutputConverter.h" -#include "cmStringCommand.h" #include "cmSystemTools.h" - -#include "cmConditionEvaluator.h" - -#include <cmsys/RegularExpression.hxx> -#include <list> -#include <stdlib.h> // required for atof +#include "cm_auto_ptr.hxx" +#include "cmake.h" static std::string cmIfCommandError( std::vector<cmExpandedCommandArgument> const& args) diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h index e071acb..56eef30 100644 --- a/Source/cmIfCommand.h +++ b/Source/cmIfCommand.h @@ -3,9 +3,17 @@ #ifndef cmIfCommand_h #define cmIfCommand_h -#include "cmCommand.h" +#include <cmConfigure.h> +#include <string> +#include <vector> +#include "cmCommand.h" #include "cmFunctionBlocker.h" +#include "cmListFileCache.h" + +class cmExecutionStatus; +class cmExpandedCommandArgument; +class cmMakefile; class cmIfFunctionBlocker : public cmFunctionBlocker { diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index e89641f..12e0c9a 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -2,8 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmIncludeCommand.h" +#include <sstream> + #include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmPolicies.h" #include "cmSystemTools.h" +#include "cmake.h" + +class cmExecutionStatus; // cmIncludeCommand bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args, @@ -62,7 +69,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args, module += ".cmake"; std::string mfile = this->Makefile->GetModulesFile(module.c_str()); if (!mfile.empty()) { - fname = mfile.c_str(); + fname = mfile; } } @@ -104,7 +111,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args, } std::string listFile = cmSystemTools::CollapseFullPath( - fname.c_str(), this->Makefile->GetCurrentSourceDirectory()); + fname, this->Makefile->GetCurrentSourceDirectory()); if (optional && !cmSystemTools::FileExists(listFile.c_str())) { if (!resultVarName.empty()) { this->Makefile->AddDefinition(resultVarName, "NOTFOUND"); diff --git a/Source/cmIncludeCommand.h b/Source/cmIncludeCommand.h index 9065ef7..78edd43 100644 --- a/Source/cmIncludeCommand.h +++ b/Source/cmIncludeCommand.h @@ -3,8 +3,14 @@ #ifndef cmIncludeCommand_h #define cmIncludeCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmIncludeCommand * \brief cmIncludeCommand defines a list of distant * files that can be "included" in the current list file. diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index 2260366..cdb0279 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -2,8 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmIncludeDirectoryCommand.h" +#include <algorithm> +#include <set> + +#include "cmMakefile.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmIncludeDirectoryCommand bool cmIncludeDirectoryCommand::InitialPass( std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmIncludeDirectoryCommand.h b/Source/cmIncludeDirectoryCommand.h index d0a20b3..287b5d3 100644 --- a/Source/cmIncludeDirectoryCommand.h +++ b/Source/cmIncludeDirectoryCommand.h @@ -3,8 +3,14 @@ #ifndef cmIncludeDirectoryCommand_h #define cmIncludeDirectoryCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmIncludeDirectoryCommand * \brief Add include directories to the build. * diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx index e7e9402..03388c7 100644 --- a/Source/cmIncludeExternalMSProjectCommand.cxx +++ b/Source/cmIncludeExternalMSProjectCommand.cxx @@ -3,7 +3,10 @@ #include "cmIncludeExternalMSProjectCommand.h" #ifdef _WIN32 +#include "cmMakefile.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cmTarget.h" #endif class cmExecutionStatus; diff --git a/Source/cmIncludeRegularExpressionCommand.cxx b/Source/cmIncludeRegularExpressionCommand.cxx index 6dc20a0..073c95f 100644 --- a/Source/cmIncludeRegularExpressionCommand.cxx +++ b/Source/cmIncludeRegularExpressionCommand.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmIncludeRegularExpressionCommand.h" +#include "cmMakefile.h" + +class cmExecutionStatus; + // cmIncludeRegularExpressionCommand bool cmIncludeRegularExpressionCommand::InitialPass( std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmIncludeRegularExpressionCommand.h b/Source/cmIncludeRegularExpressionCommand.h index b7c937d..c68d9f2 100644 --- a/Source/cmIncludeRegularExpressionCommand.h +++ b/Source/cmIncludeRegularExpressionCommand.h @@ -3,8 +3,14 @@ #ifndef cmIncludeRegularExpressionCommand_h #define cmIncludeRegularExpressionCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmIncludeRegularExpressionCommand * \brief Set the regular expression for following #includes. * diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 476755a..bf59e88 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -2,18 +2,33 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallCommand.h" +#include <algorithm> +#include <cmsys/Glob.hxx> +#include <sstream> +#include <stddef.h> + +#include "cmAlgorithms.h" +#include "cmCommandArgumentsHelper.h" #include "cmExportSet.h" +#include "cmExportSetMap.h" +#include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" #include "cmInstallCommandArguments.h" #include "cmInstallDirectoryGenerator.h" #include "cmInstallExportGenerator.h" #include "cmInstallFilesGenerator.h" +#include "cmInstallGenerator.h" #include "cmInstallScriptGenerator.h" #include "cmInstallTargetGenerator.h" +#include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cmTarget.h" #include "cmTargetExport.h" +#include "cmake.h" -#include <cmsys/Glob.hxx> +class cmExecutionStatus; static cmInstallTargetGenerator* CreateInstallTargetGenerator( cmTarget& target, const cmInstallCommandArguments& args, bool impLib, @@ -971,7 +986,7 @@ bool cmInstallCommand::HandleDirectoryMode( std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; - this->SetError(e.str().c_str()); + this->SetError(e.str()); return false; } exclude_from_all = true; diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h index b350330..187a6ce 100644 --- a/Source/cmInstallCommand.h +++ b/Source/cmInstallCommand.h @@ -3,8 +3,14 @@ #ifndef cmInstallCommand_h #define cmInstallCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmInstallCommand * \brief Specifies where to install some files * diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx index 50f97e9..86fd46d 100644 --- a/Source/cmInstallFilesCommand.cxx +++ b/Source/cmInstallFilesCommand.cxx @@ -2,10 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallFilesCommand.h" +#include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" #include "cmInstallFilesGenerator.h" +#include "cmInstallGenerator.h" +#include "cmMakefile.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmExecutableCommand bool cmInstallFilesCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h index da09fae..c3e2919 100644 --- a/Source/cmInstallFilesCommand.h +++ b/Source/cmInstallFilesCommand.h @@ -3,8 +3,14 @@ #ifndef cmInstallFilesCommand_h #define cmInstallFilesCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmInstallFilesCommand * \brief Specifies where to install some files * diff --git a/Source/cmInstallTargetsCommand.cxx b/Source/cmInstallTargetsCommand.cxx index 07f990d..e00eba0 100644 --- a/Source/cmInstallTargetsCommand.cxx +++ b/Source/cmInstallTargetsCommand.cxx @@ -2,7 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallTargetsCommand.h" +#include <utility> + #include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmTarget.h" +#include "cm_unordered_map.hxx" + +class cmExecutionStatus; // cmExecutableCommand bool cmInstallTargetsCommand::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmInstallTargetsCommand.h b/Source/cmInstallTargetsCommand.h index 0625722..150397d 100644 --- a/Source/cmInstallTargetsCommand.h +++ b/Source/cmInstallTargetsCommand.h @@ -3,8 +3,14 @@ #ifndef cmInstallTargetsCommand_h #define cmInstallTargetsCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmInstallTargetsCommand * \brief Specifies where to install some targets * diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx index 3a18a43..f863292 100644 --- a/Source/cmLinkDirectoriesCommand.cxx +++ b/Source/cmLinkDirectoriesCommand.cxx @@ -2,7 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLinkDirectoriesCommand.h" +#include <sstream> + +#include "cmMakefile.h" +#include "cmPolicies.h" #include "cmSystemTools.h" +#include "cmake.h" + +class cmExecutionStatus; // cmLinkDirectoriesCommand bool cmLinkDirectoriesCommand::InitialPass( diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h index ba0313b..387b3b9 100644 --- a/Source/cmLinkDirectoriesCommand.h +++ b/Source/cmLinkDirectoriesCommand.h @@ -3,8 +3,14 @@ #ifndef cmLinkDirectoriesCommand_h #define cmLinkDirectoriesCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmLinkDirectoriesCommand * \brief Define a list of directories containing files to link. * diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 6cc9590..295ea28 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -2,15 +2,22 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmListCommand.h" -#include "cmAlgorithms.h" -#include "cmSystemTools.h" -#include <cmsys/RegularExpression.hxx> -#include <cmsys/SystemTools.hxx> - #include <algorithm> #include <assert.h> -#include <ctype.h> +#include <cmsys/RegularExpression.hxx> +#include <iterator> +#include <sstream> +#include <stdio.h> #include <stdlib.h> // required for atoi + +#include "cmAlgorithms.h" +#include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmSystemTools.h" +#include "cmake.h" + +class cmExecutionStatus; + bool cmListCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) { diff --git a/Source/cmListCommand.h b/Source/cmListCommand.h index 43a482c..e7413ca 100644 --- a/Source/cmListCommand.h +++ b/Source/cmListCommand.h @@ -3,8 +3,14 @@ #ifndef cmListCommand_h #define cmListCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmListCommand * \brief Common list operations * diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 2a06cb4..ea84877 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -5,7 +5,7 @@ #include <cmsys/FStream.hxx> #include "cmMakefile.h" -#include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmake.h" diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index e042b07..b6743f1 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -208,7 +208,7 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& args, } // Try to find the program. - std::string fullPath = cmSystemTools::FindFile(moduleName.c_str(), path); + std::string fullPath = cmSystemTools::FindFile(moduleName, path); if (fullPath == "") { std::ostringstream e; e << "Attempt to load command failed from file \"" << moduleName << "\""; @@ -237,14 +237,14 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& args, // find the init function std::string initFuncName = args[0] + "Init"; CM_INIT_FUNCTION initFunction = - (CM_INIT_FUNCTION)cmsys::DynamicLoader::GetSymbolAddress( - lib, initFuncName.c_str()); + (CM_INIT_FUNCTION)cmsys::DynamicLoader::GetSymbolAddress(lib, + initFuncName); if (!initFunction) { initFuncName = "_"; initFuncName += args[0]; initFuncName += "Init"; initFunction = (CM_INIT_FUNCTION)( - cmsys::DynamicLoader::GetSymbolAddress(lib, initFuncName.c_str())); + cmsys::DynamicLoader::GetSymbolAddress(lib, initFuncName)); } // if the symbol is found call it to set the name on the // function blocker diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index cd9af54..c27ab09 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -299,15 +299,11 @@ void cmLocalNinjaGenerator::AppendCustomCommandDeps( std::string cmLocalNinjaGenerator::BuildCommandLine( const std::vector<std::string>& cmdLines) { - // If we have no commands but we need to build a command anyway, use ":". + // If we have no commands but we need to build a command anyway, use noop. // This happens when building a POST_BUILD value for link targets that // don't use POST_BUILD. if (cmdLines.empty()) { -#ifdef _WIN32 - return "cd ."; -#else - return ":"; -#endif + return cmGlobalNinjaGenerator::SHELL_NOOP; } std::ostringstream cmd; diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 9bfc70b..d777bd5 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -2,10 +2,16 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMacroCommand.h" +#include <algorithm> +#include <sstream> +#include <stdio.h> + #include "cmAlgorithms.h" +#include "cmExecutionStatus.h" +#include "cmMakefile.h" +#include "cmPolicies.h" #include "cmState.h" #include "cmSystemTools.h" -#include "cmake.h" // define the class for macro commands class cmMacroHelperCommand : public cmCommand diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h index 8e3cd95..acb4233 100644 --- a/Source/cmMacroCommand.h +++ b/Source/cmMacroCommand.h @@ -3,9 +3,16 @@ #ifndef cmMacroCommand_h #define cmMacroCommand_h -#include "cmCommand.h" +#include <cmConfigure.h> +#include <string> +#include <vector> +#include "cmCommand.h" #include "cmFunctionBlocker.h" +#include "cmListFileCache.h" + +class cmExecutionStatus; +class cmMakefile; class cmMacroFunctionBlocker : public cmFunctionBlocker { diff --git a/Source/cmMakeDirectoryCommand.cxx b/Source/cmMakeDirectoryCommand.cxx index fda9eea..06e295b 100644 --- a/Source/cmMakeDirectoryCommand.cxx +++ b/Source/cmMakeDirectoryCommand.cxx @@ -2,8 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakeDirectoryCommand.h" +#include "cmMakefile.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmMakeDirectoryCommand bool cmMakeDirectoryCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmMakeDirectoryCommand.h b/Source/cmMakeDirectoryCommand.h index 74b4a63..d9cce6f 100644 --- a/Source/cmMakeDirectoryCommand.h +++ b/Source/cmMakeDirectoryCommand.h @@ -3,8 +3,14 @@ #ifndef cmMakeDirectoryCommand_h #define cmMakeDirectoryCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmMakeDirectoryCommand * \brief Specify auxiliary source code directories. * diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index 7297193..b2f0d22 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -2,8 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMarkAsAdvancedCommand.h" +#include "cmMakefile.h" #include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cmake.h" + +class cmExecutionStatus; // cmMarkAsAdvancedCommand bool cmMarkAsAdvancedCommand::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmMarkAsAdvancedCommand.h b/Source/cmMarkAsAdvancedCommand.h index 0f5270c..26caa66 100644 --- a/Source/cmMarkAsAdvancedCommand.h +++ b/Source/cmMarkAsAdvancedCommand.h @@ -3,8 +3,14 @@ #ifndef cmMarkAsAdvancedCommand_h #define cmMarkAsAdvancedCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmMarkAsAdvancedCommand * \brief mark_as_advanced command * diff --git a/Source/cmMathCommand.cxx b/Source/cmMathCommand.cxx index 42e6b90..c1cd1b6 100644 --- a/Source/cmMathCommand.cxx +++ b/Source/cmMathCommand.cxx @@ -2,7 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMathCommand.h" +#include <stdio.h> + #include "cmExprParserHelper.h" +#include "cmMakefile.h" + +class cmExecutionStatus; bool cmMathCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmMathCommand.h b/Source/cmMathCommand.h index 17a1575..9b49b21 100644 --- a/Source/cmMathCommand.h +++ b/Source/cmMathCommand.h @@ -3,8 +3,14 @@ #ifndef cmMathCommand_h #define cmMathCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /// Mathematical expressions: math(EXPR ...) command. class cmMathCommand : public cmCommand { diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 83d847a..2e15720 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -2,8 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMessageCommand.h" +#include <algorithm> + +#include "cmAlgorithms.h" +#include "cmMakefile.h" #include "cmMessenger.h" #include "cmSystemTools.h" +#include "cmake.h" + +class cmExecutionStatus; // cmLibraryCommand bool cmMessageCommand::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmMessageCommand.h b/Source/cmMessageCommand.h index cd16ffa..a565635 100644 --- a/Source/cmMessageCommand.h +++ b/Source/cmMessageCommand.h @@ -3,8 +3,14 @@ #ifndef cmMessageCommand_h #define cmMessageCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmMessageCommand * \brief Displays a message to the user * diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 11773f9..d70bf8e 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -675,7 +675,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() if (!symlinkNeeded) { vars["POST_BUILD"] = postBuildCmdLine; } else { - vars["POST_BUILD"] = ":"; + vars["POST_BUILD"] = cmGlobalNinjaGenerator::SHELL_NOOP; symlinkVars["POST_BUILD"] = postBuildCmdLine; } cmGlobalNinjaGenerator& globalGen = *this->GetGlobalGenerator(); diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index d6efa2c..bbd6090 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -2,9 +2,16 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmOptionCommand.h" +#include <algorithm> + +#include "cmAlgorithms.h" +#include "cmMakefile.h" #include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmOptionCommand bool cmOptionCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmOptionCommand.h b/Source/cmOptionCommand.h index d77215a..09567ff 100644 --- a/Source/cmOptionCommand.h +++ b/Source/cmOptionCommand.h @@ -3,8 +3,14 @@ #ifndef cmOptionCommand_h #define cmOptionCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmOptionCommand * \brief Provide an option to the user * diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index 6ecd942..7a17f2c 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -4,6 +4,8 @@ #include <cmsys/FStream.hxx> #include <cmsys/RegularExpression.hxx> +#include <map> +#include <utility> #include "cmAlgorithms.h" #include "cmGeneratorExpression.h" @@ -12,6 +14,7 @@ #include "cmSourceFile.h" #include "cmSystemTools.h" #include "cmTarget.h" +#include "cm_unordered_map.hxx" class cmExecutionStatus; @@ -177,33 +180,30 @@ protected: while (cmSystemTools::GetLineFromStream(fin, line)) { if (cmHasLiteralPrefix(line.c_str(), "#include")) { // if it is an include line then create a string class - std::string currentline = line; - size_t qstart = currentline.find('\"', 8); + size_t qstart = line.find('\"', 8); size_t qend; // if a quote is not found look for a < if (qstart == std::string::npos) { - qstart = currentline.find('<', 8); + qstart = line.find('<', 8); // if a < is not found then move on if (qstart == std::string::npos) { - cmSystemTools::Error("unknown include directive ", - currentline.c_str()); + cmSystemTools::Error("unknown include directive ", line.c_str()); continue; } else { - qend = currentline.find('>', qstart + 1); + qend = line.find('>', qstart + 1); } } else { - qend = currentline.find('\"', qstart + 1); + qend = line.find('\"', qstart + 1); } // extract the file being included - std::string includeFile = - currentline.substr(qstart + 1, qend - qstart - 1); + std::string includeFile = line.substr(qstart + 1, qend - qstart - 1); // see if the include matches the regular expression if (!this->IncludeFileRegularExpression.find(includeFile)) { if (this->Verbose) { std::string message = "Skipping "; message += includeFile; message += " for file "; - message += info->FullPath.c_str(); + message += info->FullPath; cmSystemTools::Error(message.c_str(), CM_NULLPTR); } continue; @@ -517,7 +517,7 @@ bool cmOutputRequiredFilesCommand::InitialPass( const cmDependInformation* info = md.FindDependencies(this->File.c_str()); if (info) { // write them out - FILE* fout = cmsys::SystemTools::Fopen(this->OutputFile.c_str(), "w"); + FILE* fout = cmsys::SystemTools::Fopen(this->OutputFile, "w"); if (!fout) { std::string err = "Can not open output file: "; err += this->OutputFile; diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx index e45e3a5..0a2dd12 100644 --- a/Source/cmParseArgumentsCommand.cxx +++ b/Source/cmParseArgumentsCommand.cxx @@ -2,8 +2,19 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmParseArgumentsCommand.h" +#include <algorithm> +#include <map> +#include <set> +#include <sstream> +#include <stddef.h> +#include <utility> + #include "cmAlgorithms.h" +#include "cmMakefile.h" #include "cmSystemTools.h" +#include "cmake.h" + +class cmExecutionStatus; static std::string escape_arg(const std::string& arg) { diff --git a/Source/cmParseArgumentsCommand.h b/Source/cmParseArgumentsCommand.h index af87d81..079eadb 100644 --- a/Source/cmParseArgumentsCommand.h +++ b/Source/cmParseArgumentsCommand.h @@ -3,8 +3,14 @@ #ifndef cmParseArgumentsCommand_h #define cmParseArgumentsCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmParseArgumentsCommand * */ diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 4188661..4e0fa57 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -2,7 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmProjectCommand.h" +#include <cmsys/RegularExpression.hxx> +#include <sstream> +#include <stdio.h> + +#include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cmake.h" + +class cmExecutionStatus; // cmProjectCommand bool cmProjectCommand::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmProjectCommand.h b/Source/cmProjectCommand.h index ef554f3..cd92176 100644 --- a/Source/cmProjectCommand.h +++ b/Source/cmProjectCommand.h @@ -3,8 +3,14 @@ #ifndef cmProjectCommand_h #define cmProjectCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmProjectCommand * \brief Specify the name for this build project. * diff --git a/Source/cmReturnCommand.h b/Source/cmReturnCommand.h index 06b91bc..9496d67 100644 --- a/Source/cmReturnCommand.h +++ b/Source/cmReturnCommand.h @@ -3,8 +3,14 @@ #ifndef cmReturnCommand_h #define cmReturnCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmReturnCommand * \brief Return from a directory or function * diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index fd3d482..ff0b836 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -2,8 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSearchPath.h" +#include <cassert> + #include "cmAlgorithms.h" #include "cmFindCommon.h" +#include "cmMakefile.h" #include "cmSystemTools.h" cmSearchPath::cmSearchPath(cmFindCommon* findCmd) diff --git a/Source/cmSeparateArgumentsCommand.cxx b/Source/cmSeparateArgumentsCommand.cxx index 77546a3..b27d227 100644 --- a/Source/cmSeparateArgumentsCommand.cxx +++ b/Source/cmSeparateArgumentsCommand.cxx @@ -2,8 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSeparateArgumentsCommand.h" +#include <algorithm> +#include <sstream> + +#include "cmMakefile.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmSeparateArgumentsCommand bool cmSeparateArgumentsCommand::InitialPass( std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmSeparateArgumentsCommand.h b/Source/cmSeparateArgumentsCommand.h index d80d043..1cbf56e 100644 --- a/Source/cmSeparateArgumentsCommand.h +++ b/Source/cmSeparateArgumentsCommand.h @@ -3,8 +3,14 @@ #ifndef cmSeparateArgumentsCommand_h #define cmSeparateArgumentsCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmSeparateArgumentsCommand * \brief separate_arguments command * diff --git a/Source/cmServerDictionary.h b/Source/cmServerDictionary.h index 2d64cbd..e6a7ae6 100644 --- a/Source/cmServerDictionary.h +++ b/Source/cmServerDictionary.h @@ -62,6 +62,7 @@ static const std::string kMESSAGE_KEY = "message"; static const std::string kMINOR_KEY = "minor"; static const std::string kNAME_KEY = "name"; static const std::string kPATH_KEY = "path"; +static const std::string kPLATFORM_KEY = "platform"; static const std::string kPROGRESS_CURRENT_KEY = "progressCurrent"; static const std::string kPROGRESS_MAXIMUM_KEY = "progressMaximum"; static const std::string kPROGRESS_MESSAGE_KEY = "progressMessage"; @@ -77,6 +78,7 @@ static const std::string kSUPPORTED_PROTOCOL_VERSIONS = static const std::string kSYSROOT_KEY = "sysroot"; static const std::string kTARGETS_KEY = "targets"; static const std::string kTITLE_KEY = "title"; +static const std::string kTOOLSET_KEY = "toolset"; static const std::string kTRACE_EXPAND_KEY = "traceExpand"; static const std::string kTRACE_KEY = "trace"; static const std::string kTYPE_KEY = "type"; diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index e50878b..853704b 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -82,7 +82,7 @@ static void getCMakeInputs(const cmGlobalGenerator* gg, std::vector<std::string>* tmpFiles) { const std::string cmakeRootDir = cmSystemTools::GetCMakeRoot() + '/'; - const std::vector<cmMakefile*> makefiles = gg->GetMakefiles(); + std::vector<cmMakefile*> const& makefiles = gg->GetMakefiles(); for (auto it = makefiles.begin(); it != makefiles.end(); ++it) { const std::vector<std::string> listFiles = (*it)->GetListFiles(); @@ -249,6 +249,30 @@ std::pair<int, int> cmServerProtocol1_0::ProtocolVersion() const return std::make_pair(1, 0); } +static void setErrorMessage(std::string* errorMessage, const std::string& text) +{ + if (errorMessage) { + *errorMessage = text; + } +} + +static bool testValue(cmState* state, const std::string& key, + std::string& value, const std::string& keyDescription, + std::string* errorMessage) +{ + const std::string cachedValue = std::string(state->GetCacheEntryValue(key)); + if (!cachedValue.empty() && !value.empty() && cachedValue != value) { + setErrorMessage(errorMessage, std::string("\"") + key + + "\" is set but incompatible with configured " + + keyDescription + " value."); + return false; + } + if (value.empty()) { + value = cachedValue; + } + return true; +} + bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request, std::string* errorMessage) { @@ -257,21 +281,20 @@ bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request, request.Data[kBUILD_DIRECTORY_KEY].asString(); std::string generator = request.Data[kGENERATOR_KEY].asString(); std::string extraGenerator = request.Data[kEXTRA_GENERATOR_KEY].asString(); + std::string toolset = request.Data[kTOOLSET_KEY].asString(); + std::string platform = request.Data[kPLATFORM_KEY].asString(); if (buildDirectory.empty()) { - if (errorMessage) { - *errorMessage = - std::string("\"") + kBUILD_DIRECTORY_KEY + "\" is missing."; - } + setErrorMessage(errorMessage, std::string("\"") + kBUILD_DIRECTORY_KEY + + "\" is missing."); return false; } + cmake* cm = CMakeInstance(); if (cmSystemTools::PathExists(buildDirectory)) { if (!cmSystemTools::FileIsDirectory(buildDirectory)) { - if (errorMessage) { - *errorMessage = std::string("\"") + kBUILD_DIRECTORY_KEY + - "\" exists but is not a directory."; - } + setErrorMessage(errorMessage, std::string("\"") + kBUILD_DIRECTORY_KEY + + "\" exists but is not a directory."); return false; } @@ -280,77 +303,86 @@ bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request, cmState* state = cm->GetState(); // Check generator: - const std::string cachedGenerator = - std::string(state->GetCacheEntryValue("CMAKE_GENERATOR")); - if (cachedGenerator.empty() && generator.empty()) { - if (errorMessage) { - *errorMessage = - std::string("\"") + kGENERATOR_KEY + "\" is required but unset."; - } - return false; - } - if (generator.empty()) { - generator = cachedGenerator; - } - if (generator != cachedGenerator) { - if (errorMessage) { - *errorMessage = std::string("\"") + kGENERATOR_KEY + - "\" set but incompatible with configured generator."; - } + if (!testValue(state, "CMAKE_GENERATOR", generator, "generator", + errorMessage)) { return false; } // check extra generator: - const std::string cachedExtraGenerator = - std::string(state->GetCacheEntryValue("CMAKE_EXTRA_GENERATOR")); - if (!cachedExtraGenerator.empty() && !extraGenerator.empty() && - cachedExtraGenerator != extraGenerator) { - if (errorMessage) { - *errorMessage = std::string("\"") + kEXTRA_GENERATOR_KEY + - "\" is set but incompatible with configured extra generator."; - } + if (!testValue(state, "CMAKE_EXTRA_GENERATOR", extraGenerator, + "extra generator", errorMessage)) { return false; } - if (extraGenerator.empty()) { - extraGenerator = cachedExtraGenerator; - } // check sourcedir: - const std::string cachedSourceDirectory = - std::string(state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY")); - if (!cachedSourceDirectory.empty() && !sourceDirectory.empty() && - cachedSourceDirectory != sourceDirectory) { - if (errorMessage) { - *errorMessage = std::string("\"") + kSOURCE_DIRECTORY_KEY + - "\" is set but incompatible with configured source directory."; - } + if (!testValue(state, "CMAKE_HOME_DIRECTORY", sourceDirectory, + "source directory", errorMessage)) { return false; } - if (sourceDirectory.empty()) { - sourceDirectory = cachedSourceDirectory; + + // check toolset: + if (!testValue(state, "CMAKE_GENERATOR_TOOLSET", toolset, "toolset", + errorMessage)) { + return false; + } + + // check platform: + if (!testValue(state, "CMAKE_GENERATOR_PLATFORM", platform, "platform", + errorMessage)) { + return false; } } } if (sourceDirectory.empty()) { - if (errorMessage) { - *errorMessage = std::string("\"") + kSOURCE_DIRECTORY_KEY + - "\" is unset but required."; - } + setErrorMessage(errorMessage, std::string("\"") + kSOURCE_DIRECTORY_KEY + + "\" is unset but required."); return false; } if (!cmSystemTools::FileIsDirectory(sourceDirectory)) { - if (errorMessage) { - *errorMessage = - std::string("\"") + kSOURCE_DIRECTORY_KEY + "\" is not a directory."; - } + setErrorMessage(errorMessage, std::string("\"") + kSOURCE_DIRECTORY_KEY + + "\" is not a directory."); return false; } if (generator.empty()) { - if (errorMessage) { - *errorMessage = - std::string("\"") + kGENERATOR_KEY + "\" is unset but required."; - } + setErrorMessage(errorMessage, std::string("\"") + kGENERATOR_KEY + + "\" is unset but required."); + return false; + } + + std::vector<cmake::GeneratorInfo> generators; + cm->GetRegisteredGenerators(generators); + auto baseIt = std::find_if(generators.begin(), generators.end(), + [&generator](const cmake::GeneratorInfo& info) { + return info.name == generator; + }); + if (baseIt == generators.end()) { + setErrorMessage(errorMessage, std::string("Generator \"") + generator + + "\" not supported."); + return false; + } + auto extraIt = std::find_if( + generators.begin(), generators.end(), + [&generator, &extraGenerator](const cmake::GeneratorInfo& info) { + return info.baseName == generator && info.extraName == extraGenerator; + }); + if (extraIt == generators.end()) { + setErrorMessage(errorMessage, + std::string("The combination of generator \"" + generator + + "\" and extra generator \"" + extraGenerator + + "\" is not supported.")); + return false; + } + if (!extraIt->supportsToolset && !toolset.empty()) { + setErrorMessage(errorMessage, + std::string("Toolset was provided but is not supported by " + "the requested generator.")); + return false; + } + if (!extraIt->supportsPlatform && !platform.empty()) { + setErrorMessage(errorMessage, + std::string("Platform was provided but is not supported " + "by the requested generator.")); return false; } @@ -358,13 +390,15 @@ bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request, cmExternalMakefileProjectGenerator::CreateFullGeneratorName( generator, extraGenerator); + cm->SetGeneratorToolset(toolset); + cm->SetGeneratorPlatform(platform); + cmGlobalGenerator* gg = cm->CreateGlobalGenerator(fullGeneratorName); if (!gg) { - if (errorMessage) { - *errorMessage = - std::string("Could not set up the requested combination of \"") + - kGENERATOR_KEY + "\" and \"" + kEXTRA_GENERATOR_KEY + "\""; - } + setErrorMessage( + errorMessage, + std::string("Could not set up the requested combination of \"") + + kGENERATOR_KEY + "\" and \"" + kEXTRA_GENERATOR_KEY + "\""); return false; } @@ -816,7 +850,7 @@ static Json::Value DumpTargetsList( return result; } -static Json::Value DumpProjectList(const cmake* cm, const std::string config) +static Json::Value DumpProjectList(const cmake* cm, std::string const& config) { Json::Value result = Json::arrayValue; @@ -1025,7 +1059,7 @@ cmServerResponse cmServerProtocol1_0::ProcessGlobalSettings( } static void setBool(const cmServerRequest& request, const std::string& key, - std::function<void(bool)> setter) + std::function<void(bool)> const& setter) { if (request.Data[key].isNull()) { return; diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 9f59db4..e49f142 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -2,9 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSetCommand.h" +#include <algorithm> +#include <string.h> + +#include "cmAlgorithms.h" +#include "cmMakefile.h" #include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmSetCommand bool cmSetCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmSetCommand.h b/Source/cmSetCommand.h index 6fa3865..190092a 100644 --- a/Source/cmSetCommand.h +++ b/Source/cmSetCommand.h @@ -3,8 +3,14 @@ #ifndef cmSetCommand_h #define cmSetCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmSetCommand * \brief Set a CMAKE variable * diff --git a/Source/cmSetDirectoryPropertiesCommand.cxx b/Source/cmSetDirectoryPropertiesCommand.cxx index b0de021..8d3961a 100644 --- a/Source/cmSetDirectoryPropertiesCommand.cxx +++ b/Source/cmSetDirectoryPropertiesCommand.cxx @@ -2,7 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSetDirectoryPropertiesCommand.h" -#include "cmake.h" +#include "cmMakefile.h" + +class cmExecutionStatus; // cmSetDirectoryPropertiesCommand bool cmSetDirectoryPropertiesCommand::InitialPass( diff --git a/Source/cmSetDirectoryPropertiesCommand.h b/Source/cmSetDirectoryPropertiesCommand.h index 9608742..854ad43 100644 --- a/Source/cmSetDirectoryPropertiesCommand.h +++ b/Source/cmSetDirectoryPropertiesCommand.h @@ -3,8 +3,15 @@ #ifndef cmSetDirectoryPropertiesCommand_h #define cmSetDirectoryPropertiesCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; +class cmMakefile; + class cmSetDirectoryPropertiesCommand : public cmCommand { public: diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 552f918..60c198a 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -2,13 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSetPropertyCommand.h" +#include <sstream> + #include "cmGlobalGenerator.h" -#include "cmSetSourceFilesPropertiesCommand.h" -#include "cmSetTargetPropertiesCommand.h" -#include "cmSetTestsPropertiesCommand.h" +#include "cmInstalledFile.h" +#include "cmMakefile.h" +#include "cmProperty.h" #include "cmSourceFile.h" #include "cmState.h" +#include "cmSystemTools.h" +#include "cmTarget.h" #include "cmTest.h" +#include "cmake.h" + +class cmExecutionStatus; cmSetPropertyCommand::cmSetPropertyCommand() { @@ -335,7 +342,7 @@ bool cmSetPropertyCommand::HandleCacheMode() return false; } } else if (this->PropertyName == "TYPE") { - if (!cmState::IsCacheEntryType(this->PropertyValue.c_str())) { + if (!cmState::IsCacheEntryType(this->PropertyValue)) { std::ostringstream e; e << "given invalid CACHE entry TYPE \"" << this->PropertyValue << "\""; this->SetError(e.str()); diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h index b4dff76..fd7c922 100644 --- a/Source/cmSetPropertyCommand.h +++ b/Source/cmSetPropertyCommand.h @@ -3,8 +3,19 @@ #ifndef cmSetsPropertiesCommand_h #define cmSetsPropertiesCommand_h +#include <cmConfigure.h> +#include <set> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; +class cmInstalledFile; +class cmSourceFile; +class cmTarget; +class cmTest; + class cmSetPropertyCommand : public cmCommand { public: diff --git a/Source/cmSetSourceFilesPropertiesCommand.cxx b/Source/cmSetSourceFilesPropertiesCommand.cxx index 6a87d6d..33e1b2e 100644 --- a/Source/cmSetSourceFilesPropertiesCommand.cxx +++ b/Source/cmSetSourceFilesPropertiesCommand.cxx @@ -2,9 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSetSourceFilesPropertiesCommand.h" +#include "cmMakefile.h" #include "cmSourceFile.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmSetSourceFilesPropertiesCommand bool cmSetSourceFilesPropertiesCommand::InitialPass( std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmSetSourceFilesPropertiesCommand.h b/Source/cmSetSourceFilesPropertiesCommand.h index 62cc404..8fa12c7 100644 --- a/Source/cmSetSourceFilesPropertiesCommand.h +++ b/Source/cmSetSourceFilesPropertiesCommand.h @@ -3,8 +3,15 @@ #ifndef cmSetSourceFilesPropertiesCommand_h #define cmSetSourceFilesPropertiesCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; +class cmMakefile; + class cmSetSourceFilesPropertiesCommand : public cmCommand { public: diff --git a/Source/cmSetTargetPropertiesCommand.cxx b/Source/cmSetTargetPropertiesCommand.cxx index 200b42d..da26972 100644 --- a/Source/cmSetTargetPropertiesCommand.cxx +++ b/Source/cmSetTargetPropertiesCommand.cxx @@ -2,7 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSetTargetPropertiesCommand.h" -#include "cmGlobalGenerator.h" +#include <iterator> + +#include "cmMakefile.h" +#include "cmTarget.h" + +class cmExecutionStatus; // cmSetTargetPropertiesCommand bool cmSetTargetPropertiesCommand::InitialPass( diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h index ed02fa8..c3c0d06 100644 --- a/Source/cmSetTargetPropertiesCommand.h +++ b/Source/cmSetTargetPropertiesCommand.h @@ -3,8 +3,15 @@ #ifndef cmSetTargetsPropertiesCommand_h #define cmSetTargetsPropertiesCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; +class cmMakefile; + class cmSetTargetPropertiesCommand : public cmCommand { public: diff --git a/Source/cmSetTestsPropertiesCommand.cxx b/Source/cmSetTestsPropertiesCommand.cxx index 5abb84e..4fd379f 100644 --- a/Source/cmSetTestsPropertiesCommand.cxx +++ b/Source/cmSetTestsPropertiesCommand.cxx @@ -2,8 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSetTestsPropertiesCommand.h" +#include <iterator> + +#include "cmMakefile.h" #include "cmTest.h" -#include "cmake.h" + +class cmExecutionStatus; // cmSetTestsPropertiesCommand bool cmSetTestsPropertiesCommand::InitialPass( diff --git a/Source/cmSetTestsPropertiesCommand.h b/Source/cmSetTestsPropertiesCommand.h index 04ba76e..45aed79 100644 --- a/Source/cmSetTestsPropertiesCommand.h +++ b/Source/cmSetTestsPropertiesCommand.h @@ -3,8 +3,15 @@ #ifndef cmSetTestsPropertiesCommand_h #define cmSetTestsPropertiesCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; +class cmMakefile; + class cmSetTestsPropertiesCommand : public cmCommand { public: diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 18c2a3e..4322a6d 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -2,9 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSiteNameCommand.h" +#include <cmsys/RegularExpression.hxx> + +#include "cmMakefile.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" -#include <cmsys/RegularExpression.hxx> +class cmExecutionStatus; // cmSiteNameCommand bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmSiteNameCommand.h b/Source/cmSiteNameCommand.h index 48d1035..01023b9 100644 --- a/Source/cmSiteNameCommand.h +++ b/Source/cmSiteNameCommand.h @@ -3,8 +3,14 @@ #ifndef cmSiteNameCommand_h #define cmSiteNameCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmSiteNameCommand * \brief site_name command * diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index ff3ec7f..3f20d4e 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -69,7 +69,7 @@ bool cmSourceGroupCommand::InitialPass(std::vector<std::string> const& args, src += "/"; src += args[i]; } - src = cmSystemTools::CollapseFullPath(src.c_str()); + src = cmSystemTools::CollapseFullPath(src); sg->AddGroupFile(src); } else { std::ostringstream err; diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 33d22e4..512bc91 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -2,18 +2,23 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmStringCommand.h" -#include "cmCryptoHash.h" -#include "cmSystemTools.h" - +#include <algorithm> #include <cmsys/RegularExpression.hxx> -#include <cmsys/SystemTools.hxx> - #include <ctype.h> -#include <stdlib.h> // required for atoi -#include <time.h> +#include <sstream> +#include <stdio.h> +#include <stdlib.h> + +#include "cmAlgorithms.h" +#include "cmCryptoHash.h" +#include "cmGeneratorExpression.h" +#include "cmMakefile.h" +#include "cmSystemTools.h" +#include "cmTimestamp.h" +#include "cmUuid.h" +#include "cm_auto_ptr.hxx" -#include <cmTimestamp.h> -#include <cmUuid.h> +class cmExecutionStatus; bool cmStringCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index b928f3c..c63bc3f 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -3,12 +3,13 @@ #ifndef cmStringCommand_h #define cmStringCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" -class cmMakefile; -namespace cmsys { -class RegularExpression; -} +class cmExecutionStatus; /** \class cmStringCommand * \brief Common string operations diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx index d502c5f..3727dfa 100644 --- a/Source/cmSubdirCommand.cxx +++ b/Source/cmSubdirCommand.cxx @@ -2,8 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSubdirCommand.h" +#include "cmMakefile.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmSubdirCommand bool cmSubdirCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) @@ -28,12 +31,10 @@ bool cmSubdirCommand::InitialPass(std::vector<std::string> const& args, // if they specified a relative path then compute the full std::string srcPath = - std::string(this->Makefile->GetCurrentSourceDirectory()) + "/" + - i->c_str(); + std::string(this->Makefile->GetCurrentSourceDirectory()) + "/" + *i; if (cmSystemTools::FileIsDirectory(srcPath)) { std::string binPath = - std::string(this->Makefile->GetCurrentBinaryDirectory()) + "/" + - i->c_str(); + std::string(this->Makefile->GetCurrentBinaryDirectory()) + "/" + *i; this->Makefile->AddSubDirectory(srcPath, binPath, excludeFromAll, false); } // otherwise it is a full path diff --git a/Source/cmSubdirCommand.h b/Source/cmSubdirCommand.h index 0778638..ce1f876 100644 --- a/Source/cmSubdirCommand.h +++ b/Source/cmSubdirCommand.h @@ -3,8 +3,14 @@ #ifndef cmSubdirCommand_h #define cmSubdirCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmSubdirCommand * \brief Specify a list of subdirectories to build. * diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 9626992..e173036 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -2,10 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetLinkLibrariesCommand.h" +#include <sstream> +#include <string.h> + #include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmPolicies.h" #include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmake.h" + +class cmExecutionStatus; const char* cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[3] = { "general", "debug", "optimized" diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h index 69bb6eb..762b48f 100644 --- a/Source/cmTargetLinkLibrariesCommand.h +++ b/Source/cmTargetLinkLibrariesCommand.h @@ -3,7 +3,15 @@ #ifndef cmTargetLinkLibrariesCommand_h #define cmTargetLinkLibrariesCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +#include "cmTargetLinkLibraryType.h" + +class cmExecutionStatus; +class cmTarget; /** \class cmTargetLinkLibrariesCommand * \brief Specify a list of libraries to link into executables. diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx index e2e02ad..7aba0f8 100644 --- a/Source/cmTargetPropCommandBase.cxx +++ b/Source/cmTargetPropCommandBase.cxx @@ -3,6 +3,7 @@ #include "cmTargetPropCommandBase.h" #include "cmGlobalGenerator.h" +#include "cmMakefile.h" bool cmTargetPropCommandBase::HandleArguments( std::vector<std::string> const& args, const std::string& prop, diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx index 933818e..b6bfbfa 100644 --- a/Source/cmTryCompileCommand.cxx +++ b/Source/cmTryCompileCommand.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTryCompileCommand.h" +#include "cmMakefile.h" +#include "cmake.h" + +class cmExecutionStatus; + // cmTryCompileCommand bool cmTryCompileCommand::InitialPass(std::vector<std::string> const& argv, cmExecutionStatus&) diff --git a/Source/cmTryCompileCommand.h b/Source/cmTryCompileCommand.h index ed74ae1..52a0345 100644 --- a/Source/cmTryCompileCommand.h +++ b/Source/cmTryCompileCommand.h @@ -3,8 +3,15 @@ #ifndef cmTryCompileCommand_h #define cmTryCompileCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCoreTryCompile.h" +class cmCommand; +class cmExecutionStatus; + /** \class cmTryCompileCommand * \brief Specifies where to install some files * diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 6787c8e..c4fc94e 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -2,11 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTryRunCommand.h" +#include <cmsys/FStream.hxx> +#include <stdio.h> +#include <string.h> + +#include "cmMakefile.h" #include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" -#include "cmTryCompileCommand.h" +#include "cmake.h" -#include <cmsys/FStream.hxx> +class cmExecutionStatus; // cmTryRunCommand bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv, @@ -80,8 +86,9 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv, // although they could be used together, don't allow it, because // using OUTPUT_VARIABLE makes crosscompiling harder - if (this->OutputVariable.size() && (!this->RunOutputVariable.empty() || - !this->CompileOutputVariable.empty())) { + if (!this->OutputVariable.empty() && + (!this->RunOutputVariable.empty() || + !this->CompileOutputVariable.empty())) { cmSystemTools::Error( "You cannot use OUTPUT_VARIABLE together with COMPILE_OUTPUT_VARIABLE " "or RUN_OUTPUT_VARIABLE. Please use only COMPILE_OUTPUT_VARIABLE and/or " diff --git a/Source/cmTryRunCommand.h b/Source/cmTryRunCommand.h index 24447ed..8b44ac5 100644 --- a/Source/cmTryRunCommand.h +++ b/Source/cmTryRunCommand.h @@ -3,8 +3,15 @@ #ifndef cmTryRunCommand_h #define cmTryRunCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCoreTryCompile.h" +class cmCommand; +class cmExecutionStatus; + /** \class cmTryRunCommand * \brief Specifies where to install some files * diff --git a/Source/cmUnsetCommand.cxx b/Source/cmUnsetCommand.cxx index 2fea6192..31525ba 100644 --- a/Source/cmUnsetCommand.cxx +++ b/Source/cmUnsetCommand.cxx @@ -2,8 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmUnsetCommand.h" +#include <string.h> + +#include "cmAlgorithms.h" +#include "cmMakefile.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmUnsetCommand bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmUnsetCommand.h b/Source/cmUnsetCommand.h index 37b9270..5b07202 100644 --- a/Source/cmUnsetCommand.h +++ b/Source/cmUnsetCommand.h @@ -3,8 +3,14 @@ #ifndef cmUnsetCommand_h #define cmUnsetCommand_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmUnsetCommand * \brief Unset a CMAKE variable * diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx index ffeaa51..3e72d75 100644 --- a/Source/cmUseMangledMesaCommand.cxx +++ b/Source/cmUseMangledMesaCommand.cxx @@ -108,5 +108,5 @@ void cmUseMangledMesaCommand::CopyAndFullPathMesaHeader(const char* source, fin.close(); fout.close(); cmSystemTools::CopyFileIfDifferent(tempOutputFile.c_str(), outFile.c_str()); - cmSystemTools::RemoveFile(tempOutputFile.c_str()); + cmSystemTools::RemoveFile(tempOutputFile); } diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index f98d512..3b78abe 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -7,7 +7,7 @@ #include "cmMakefile.h" #include "cmPolicies.h" #include "cmState.h" -#include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" class cmExecutionStatus; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 9c857f2..22167ca 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -10,27 +10,6 @@ #include "cmLocalVisualStudio7Generator.h" #include "cmMakefile.h" #include "cmSourceFile.h" -#include "cmVS10CLFlagTable.h" -#include "cmVS10LibFlagTable.h" -#include "cmVS10LinkFlagTable.h" -#include "cmVS10MASMFlagTable.h" -#include "cmVS10RCFlagTable.h" -#include "cmVS11CLFlagTable.h" -#include "cmVS11LibFlagTable.h" -#include "cmVS11LinkFlagTable.h" -#include "cmVS11MASMFlagTable.h" -#include "cmVS11RCFlagTable.h" -#include "cmVS12CLFlagTable.h" -#include "cmVS12LibFlagTable.h" -#include "cmVS12LinkFlagTable.h" -#include "cmVS12MASMFlagTable.h" -#include "cmVS12RCFlagTable.h" -#include "cmVS140CLFlagTable.h" -#include "cmVS141CLFlagTable.h" -#include "cmVS14LibFlagTable.h" -#include "cmVS14LinkFlagTable.h" -#include "cmVS14MASMFlagTable.h" -#include "cmVS14RCFlagTable.h" #include "cmVisualStudioGeneratorOptions.h" #include "windows.h" @@ -38,102 +17,6 @@ static std::string const kWINDOWS_7_1_SDK = "Windows7.1SDK"; -cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetClFlagTable() const -{ - if (this->MSTools) { - cmGlobalVisualStudioGenerator::VSVersion v = - this->LocalGenerator->GetVersion(); - if (v >= cmGlobalVisualStudioGenerator::VS14) { - // FIXME: All flag table selection should be based on the toolset name. - // See issue #16153. For now, treat VS 15's toolset as a special case. - const char* toolset = this->GlobalGenerator->GetPlatformToolset(); - if (toolset && cmHasLiteralPrefix(toolset, "v141")) { - return cmVS141CLFlagTable; - } - return cmVS140CLFlagTable; - } else if (v >= cmGlobalVisualStudioGenerator::VS12) { - return cmVS12CLFlagTable; - } else if (v == cmGlobalVisualStudioGenerator::VS11) { - return cmVS11CLFlagTable; - } else { - return cmVS10CLFlagTable; - } - } - return 0; -} - -cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetRcFlagTable() const -{ - if (this->MSTools) { - cmGlobalVisualStudioGenerator::VSVersion v = - this->LocalGenerator->GetVersion(); - if (v >= cmGlobalVisualStudioGenerator::VS14) { - return cmVS14RCFlagTable; - } else if (v >= cmGlobalVisualStudioGenerator::VS12) { - return cmVS12RCFlagTable; - } else if (v == cmGlobalVisualStudioGenerator::VS11) { - return cmVS11RCFlagTable; - } else { - return cmVS10RCFlagTable; - } - } - return 0; -} - -cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetLibFlagTable() const -{ - if (this->MSTools) { - cmGlobalVisualStudioGenerator::VSVersion v = - this->LocalGenerator->GetVersion(); - if (v >= cmGlobalVisualStudioGenerator::VS14) { - return cmVS14LibFlagTable; - } else if (v >= cmGlobalVisualStudioGenerator::VS12) { - return cmVS12LibFlagTable; - } else if (v == cmGlobalVisualStudioGenerator::VS11) { - return cmVS11LibFlagTable; - } else { - return cmVS10LibFlagTable; - } - } - return 0; -} - -cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetLinkFlagTable() const -{ - if (this->MSTools) { - cmGlobalVisualStudioGenerator::VSVersion v = - this->LocalGenerator->GetVersion(); - if (v >= cmGlobalVisualStudioGenerator::VS14) { - return cmVS14LinkFlagTable; - } else if (v >= cmGlobalVisualStudioGenerator::VS12) { - return cmVS12LinkFlagTable; - } else if (v == cmGlobalVisualStudioGenerator::VS11) { - return cmVS11LinkFlagTable; - } else { - return cmVS10LinkFlagTable; - } - } - return 0; -} - -cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetMasmFlagTable() const -{ - if (this->MSTools) { - cmGlobalVisualStudioGenerator::VSVersion v = - this->LocalGenerator->GetVersion(); - if (v >= cmGlobalVisualStudioGenerator::VS14) { - return cmVS14MASMFlagTable; - } else if (v >= cmGlobalVisualStudioGenerator::VS12) { - return cmVS12MASMFlagTable; - } else if (v == cmGlobalVisualStudioGenerator::VS11) { - return cmVS11MASMFlagTable; - } else { - return cmVS10MASMFlagTable; - } - } - return 0; -} - static std::string cmVS10EscapeXML(std::string arg) { cmSystemTools::ReplaceString(arg, "&", "&"); @@ -1533,9 +1416,11 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( (*this->BuildFileStream) << firstString; firstString = ""; // only do firstString once hasFlags = true; + cmGlobalVisualStudio10Generator* gg = + static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator); cmVisualStudioGeneratorOptions clOptions( this->LocalGenerator, cmVisualStudioGeneratorOptions::Compiler, - this->GetClFlagTable(), 0, this); + gg->GetClFlagTable(), 0, this); if (compileAs) { clOptions.AddFlag("CompileAs", compileAs); } @@ -1696,8 +1581,10 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( // copied from cmLocalVisualStudio7Generator.cxx 805 // TODO: Integrate code below with cmLocalVisualStudio7Generator. + cmGlobalVisualStudio10Generator* gg = + static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator); CM_AUTO_PTR<Options> pOptions(new Options( - this->LocalGenerator, Options::Compiler, this->GetClFlagTable())); + this->LocalGenerator, Options::Compiler, gg->GetClFlagTable())); Options& clOptions = *pOptions; std::string flags; @@ -1861,8 +1748,10 @@ bool cmVisualStudio10TargetGenerator::ComputeRcOptions() bool cmVisualStudio10TargetGenerator::ComputeRcOptions( std::string const& configName) { + cmGlobalVisualStudio10Generator* gg = + static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator); CM_AUTO_PTR<Options> pOptions(new Options( - this->LocalGenerator, Options::ResourceCompiler, this->GetRcFlagTable())); + this->LocalGenerator, Options::ResourceCompiler, gg->GetRcFlagTable())); Options& rcOptions = *pOptions; std::string CONFIG = cmSystemTools::UpperCase(configName); @@ -1918,8 +1807,10 @@ bool cmVisualStudio10TargetGenerator::ComputeMasmOptions() bool cmVisualStudio10TargetGenerator::ComputeMasmOptions( std::string const& configName) { + cmGlobalVisualStudio10Generator* gg = + static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator); CM_AUTO_PTR<Options> pOptions(new Options( - this->LocalGenerator, Options::MasmCompiler, this->GetMasmFlagTable())); + this->LocalGenerator, Options::MasmCompiler, gg->GetMasmFlagTable())); Options& masmOptions = *pOptions; std::string CONFIG = cmSystemTools::UpperCase(configName); @@ -1968,9 +1859,11 @@ void cmVisualStudio10TargetGenerator::WriteLibOptions( libflags, cmSystemTools::UpperCase(config), this->GeneratorTarget); if (!libflags.empty()) { this->WriteString("<Lib>\n", 2); + cmGlobalVisualStudio10Generator* gg = + static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator); cmVisualStudioGeneratorOptions libOptions( this->LocalGenerator, cmVisualStudioGeneratorOptions::Linker, - this->GetLibFlagTable(), 0, this); + gg->GetLibFlagTable(), 0, this); libOptions.Parse(libflags.c_str()); libOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", ""); libOptions.OutputFlagMap(*this->BuildFileStream, " "); @@ -2163,8 +2056,10 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions() bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( std::string const& config) { + cmGlobalVisualStudio10Generator* gg = + static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator); CM_AUTO_PTR<Options> pOptions(new Options( - this->LocalGenerator, Options::Linker, this->GetLinkFlagTable(), 0, this)); + this->LocalGenerator, Options::Linker, gg->GetLinkFlagTable(), 0, this)); Options& linkOptions = *pOptions; const std::string& linkLanguage = diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index c62be7e..54b9569 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -121,12 +121,6 @@ private: bool IsXamlHeader(const std::string& headerFile); bool IsXamlSource(const std::string& headerFile); - cmIDEFlagTable const* GetClFlagTable() const; - cmIDEFlagTable const* GetRcFlagTable() const; - cmIDEFlagTable const* GetLibFlagTable() const; - cmIDEFlagTable const* GetLinkFlagTable() const; - cmIDEFlagTable const* GetMasmFlagTable() const; - bool ForceOld(const std::string& source) const; private: diff --git a/Source/cmVisualStudio10ToolsetOptions.cxx b/Source/cmVisualStudio10ToolsetOptions.cxx new file mode 100644 index 0000000..b928f43 --- /dev/null +++ b/Source/cmVisualStudio10ToolsetOptions.cxx @@ -0,0 +1,134 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include "cmVisualStudio10ToolsetOptions.h" + +#include "cmAlgorithms.h" +#include "cmIDEFlagTable.h" +#include "cmVisualStudioGeneratorOptions.h" + +#include "cmVS10CLFlagTable.h" +#include "cmVS10LibFlagTable.h" +#include "cmVS10LinkFlagTable.h" +#include "cmVS10MASMFlagTable.h" +#include "cmVS10RCFlagTable.h" +#include "cmVS11CLFlagTable.h" +#include "cmVS11LibFlagTable.h" +#include "cmVS11LinkFlagTable.h" +#include "cmVS11MASMFlagTable.h" +#include "cmVS11RCFlagTable.h" +#include "cmVS12CLFlagTable.h" +#include "cmVS12LibFlagTable.h" +#include "cmVS12LinkFlagTable.h" +#include "cmVS12MASMFlagTable.h" +#include "cmVS12RCFlagTable.h" +#include "cmVS140CLFlagTable.h" +#include "cmVS141CLFlagTable.h" +#include "cmVS14LibFlagTable.h" +#include "cmVS14LinkFlagTable.h" +#include "cmVS14MASMFlagTable.h" +#include "cmVS14RCFlagTable.h" + +cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetClFlagTable( + std::string const& name, std::string const& toolset) const +{ + std::string const useToolset = this->GetToolsetName(name, toolset); + + if (toolset == "v141") { + return cmVS141CLFlagTable; + } else if (useToolset == "v140") { + return cmVS140CLFlagTable; + } else if (useToolset == "v120") { + return cmVS12CLFlagTable; + } else if (useToolset == "v110") { + return cmVS11CLFlagTable; + } else if (useToolset == "v100") { + return cmVS10CLFlagTable; + } else { + return 0; + } +} + +cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetRcFlagTable( + std::string const& name, std::string const& toolset) const +{ + std::string const useToolset = this->GetToolsetName(name, toolset); + + if ((useToolset == "v140") || (useToolset == "v141")) { + return cmVS14RCFlagTable; + } else if (useToolset == "v120") { + return cmVS12RCFlagTable; + } else if (useToolset == "v110") { + return cmVS11RCFlagTable; + } else if (useToolset == "v100") { + return cmVS10RCFlagTable; + } else { + return 0; + } +} + +cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetLibFlagTable( + std::string const& name, std::string const& toolset) const +{ + std::string const useToolset = this->GetToolsetName(name, toolset); + + if ((useToolset == "v140") || (useToolset == "v141")) { + return cmVS14LibFlagTable; + } else if (useToolset == "v120") { + return cmVS12LibFlagTable; + } else if (useToolset == "v110") { + return cmVS11LibFlagTable; + } else if (useToolset == "v100") { + return cmVS10LibFlagTable; + } else { + return 0; + } +} + +cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetLinkFlagTable( + std::string const& name, std::string const& toolset) const +{ + std::string const useToolset = this->GetToolsetName(name, toolset); + + if ((useToolset == "v140") || (useToolset == "v141")) { + return cmVS14LinkFlagTable; + } else if (useToolset == "v120") { + return cmVS12LinkFlagTable; + } else if (useToolset == "v110") { + return cmVS11LinkFlagTable; + } else if (useToolset == "v100") { + return cmVS10LinkFlagTable; + } else { + return 0; + } +} + +cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetMasmFlagTable( + std::string const& name, std::string const& toolset) const +{ + std::string const useToolset = this->GetToolsetName(name, toolset); + + if ((useToolset == "v140") || (useToolset == "v141")) { + return cmVS14MASMFlagTable; + } else if (useToolset == "v120") { + return cmVS12MASMFlagTable; + } else if (useToolset == "v110") { + return cmVS11MASMFlagTable; + } else if (useToolset == "v100") { + return cmVS10MASMFlagTable; + } else { + return 0; + } +} + +std::string cmVisualStudio10ToolsetOptions::GetToolsetName( + std::string const& name, std::string const& toolset) const +{ + static_cast<void>(name); + std::size_t length = toolset.length(); + + if (cmHasLiteralSuffix(toolset, "_xp")) { + length -= 3; + } + + return toolset.substr(0, length); +} diff --git a/Source/cmVisualStudio10ToolsetOptions.h b/Source/cmVisualStudio10ToolsetOptions.h new file mode 100644 index 0000000..ea6c9c8 --- /dev/null +++ b/Source/cmVisualStudio10ToolsetOptions.h @@ -0,0 +1,33 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmVisualStudio10ToolsetOptions_h +#define cmVisualStudio10ToolsetOptions_h + +#include "cmStandardIncludes.h" + +struct cmIDEFlagTable; + +/** \class cmVisualStudio10ToolsetOptions + * \brief Retrieves toolset options for MSBuild. + * + * cmVisualStudio10ToolsetOptions manages toolsets within MSBuild + */ +class cmVisualStudio10ToolsetOptions +{ +public: + cmIDEFlagTable const* GetClFlagTable(std::string const& name, + std::string const& toolset) const; + cmIDEFlagTable const* GetRcFlagTable(std::string const& name, + std::string const& toolset) const; + cmIDEFlagTable const* GetLibFlagTable(std::string const& name, + std::string const& toolset) const; + cmIDEFlagTable const* GetLinkFlagTable(std::string const& name, + std::string const& toolset) const; + cmIDEFlagTable const* GetMasmFlagTable(std::string const& name, + std::string const& toolset) const; + +private: + std::string GetToolsetName(std::string const& name, + std::string const& toolset) const; +}; +#endif diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index beb59bf..38ea637 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -3,7 +3,12 @@ #include "cmWhileCommand.h" #include "cmConditionEvaluator.h" +#include "cmExecutionStatus.h" +#include "cmExpandedCommandArgument.h" +#include "cmMakefile.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf) : Makefile(mf) diff --git a/Source/cmWhileCommand.h b/Source/cmWhileCommand.h index cc114ec..abd36b3 100644 --- a/Source/cmWhileCommand.h +++ b/Source/cmWhileCommand.h @@ -3,11 +3,17 @@ #ifndef cmWhileCommand_h #define cmWhileCommand_h -#include "cmCommand.h" +#include <cmConfigure.h> +#include <string> +#include <vector> +#include "cmCommand.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" +class cmExecutionStatus; +class cmMakefile; + class cmWhileFunctionBlocker : public cmFunctionBlocker { public: diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx index b3ac31c..96c8e27 100644 --- a/Source/cmWriteFileCommand.cxx +++ b/Source/cmWriteFileCommand.cxx @@ -65,7 +65,7 @@ bool cmWriteFileCommand::InitialPass(std::vector<std::string> const& args, overwrite ? std::ios::out : std::ios::app); if (!file) { std::string error = "Internal CMake error when trying to open file: "; - error += fileName.c_str(); + error += fileName; error += " for writing."; this->SetError(error); return false; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index d1159c3..44af966 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -18,6 +18,9 @@ #include <cmConfigure.h> #include <cmsys/Encoding.hxx> +#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) +#include <cmsys/ConsoleBuf.hxx> +#endif #include <iostream> #include <string.h> #include <string> @@ -153,6 +156,11 @@ static void cmakemainProgressCallback(const char* m, float prog, int main(int ac, char const* const* av) { +#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) + // Replace streambuf so we can output Unicode to console + cmsys::ConsoleBuf::Manager consoleOut(std::cout); + cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true); +#endif cmsys::Encoding::CommandLineArguments args = cmsys::Encoding::CommandLineArguments::Main(ac, av); ac = args.argc(); diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 8ab17b9..1acd240 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -10,6 +10,9 @@ #include "cmake.h" #include <cmsys/Encoding.hxx> +#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) +#include <cmsys/ConsoleBuf.hxx> +#endif #include <iostream> #include <string.h> #include <string> @@ -110,6 +113,11 @@ static const char* cmDocumentationOptions[][2] = { // this is a test driver program for cmCTest. int main(int argc, char const* const* argv) { +#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) + // Replace streambuf so we can output Unicode to console + cmsys::ConsoleBuf::Manager consoleOut(std::cout); + cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true); +#endif cmsys::Encoding::CommandLineArguments encoding_args = cmsys::Encoding::CommandLineArguments::Main(argc, argv); argc = encoding_args.argc(); diff --git a/Source/kwsys/ConsoleBuf.hxx.in b/Source/kwsys/ConsoleBuf.hxx.in index 8aeeda1..2496b45 100644 --- a/Source/kwsys/ConsoleBuf.hxx.in +++ b/Source/kwsys/ConsoleBuf.hxx.in @@ -239,8 +239,12 @@ namespace @KWSYS_NAMESPACE@ m_activeInputCodepage = input_file_codepage; break; case FILE_TYPE_CHAR: - m_isConsoleInput = true; - break; + // Check for actual console. + DWORD consoleMode; + m_isConsoleInput = GetConsoleMode(m_hInput, &consoleMode) == 0 ? false : true; + if (m_isConsoleInput) { + break; + } case FILE_TYPE_PIPE: m_activeInputCodepage = input_pipe_codepage; break; @@ -259,8 +263,12 @@ namespace @KWSYS_NAMESPACE@ m_activeOutputCodepage = output_file_codepage; break; case FILE_TYPE_CHAR: - m_isConsoleOutput = true; - break; + // Check for actual console. + DWORD consoleMode; + m_isConsoleOutput = GetConsoleMode(m_hOutput, &consoleMode) == 0 ? false : true; + if (m_isConsoleOutput) { + break; + } case FILE_TYPE_PIPE: m_activeOutputCodepage = output_pipe_codepage; break; |