diff --git a/.clang-tidy b/.clang-tidy index ccd74be274..c613cca38a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -79,4 +79,18 @@ CheckOptions: value: '0' - key: modernize-use-auto.MinTypeNameLength value: '80' + - key: readability-identifier-naming.ClassCase + value: 'CamelCase' + - key: readability-identifier-naming.ClassIgnoredRegexp + value: 'cm[A-Z][A-Za-z]+|(const_)?iterator' + - key: readability-identifier-naming.ClassMemberCase + value: 'CamelCase' + - key: readability-identifier-naming.ClassMemberIgnoredRegexp + value: 'prop[A-Z_]+' + - key: readability-identifier-naming.PrivateMemberCase + value: 'CamelCase' + - key: readability-identifier-naming.ParameterCase + value: 'camelBack' + - key: readability-identifier-naming.LocalVariableCase + value: 'camelBack' ... diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 8137d69b1b..5a3c72d355 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -306,10 +306,10 @@ bool HandleScriptMode(std::vector const& args, std::string component = helper.DefaultComponentName; int componentCount = 0; - bool doing_script = false; - bool doing_code = false; - bool exclude_from_all = false; - bool all_components = false; + bool doingScript = false; + bool doingCode = false; + bool excludeFromAll = false; + bool allComponents = false; // Scan the args once for COMPONENT. Only allow one. // @@ -320,9 +320,9 @@ bool HandleScriptMode(std::vector const& args, component = args[i]; } if (args[i] == "EXCLUDE_FROM_ALL") { - exclude_from_all = true; + excludeFromAll = true; } else if (args[i] == "ALL_COMPONENTS") { - all_components = true; + allComponents = true; } } @@ -333,7 +333,7 @@ bool HandleScriptMode(std::vector const& args, return false; } - if (all_components && componentCount == 1) { + if (allComponents && componentCount == 1) { status.SetError("ALL_COMPONENTS and COMPONENT are mutually exclusive"); return false; } @@ -343,16 +343,16 @@ bool HandleScriptMode(std::vector const& args, // for (std::string const& arg : args) { if (arg == "SCRIPT") { - doing_script = true; - doing_code = false; + doingScript = true; + doingCode = false; } else if (arg == "CODE") { - doing_script = false; - doing_code = true; + doingScript = false; + doingCode = true; } else if (arg == "COMPONENT") { - doing_script = false; - doing_code = false; - } else if (doing_script) { - doing_script = false; + doingScript = false; + doingCode = false; + } else if (doingScript) { + doingScript = false; std::string script = arg; if (!cmHasLiteralPrefix(script, "$")) { if (!cmSystemTools::FileIsFullPath(script)) { @@ -366,23 +366,23 @@ bool HandleScriptMode(std::vector const& args, } helper.Makefile->AddInstallGenerator( cm::make_unique( - script, false, component, exclude_from_all, all_components, + script, false, component, excludeFromAll, allComponents, helper.Makefile->GetBacktrace())); - } else if (doing_code) { - doing_code = false; + } else if (doingCode) { + doingCode = false; std::string const& code = arg; helper.Makefile->AddInstallGenerator( cm::make_unique( - code, true, component, exclude_from_all, all_components, + code, true, component, excludeFromAll, allComponents, helper.Makefile->GetBacktrace())); } } - if (doing_script) { + if (doingScript) { status.SetError("given no value for SCRIPT argument."); return false; } - if (doing_code) { + if (doingCode) { status.SetError("given no value for CODE argument."); return false; } @@ -699,11 +699,11 @@ bool HandleTargetsMode(std::vector const& args, cmTarget* target = helper.Makefile->FindLocalNonAliasTarget(tgt); if (!target) { // If no local target has been found, find it in the global scope. - cmTarget* const global_target = + cmTarget* const globalTarget = helper.Makefile->GetGlobalGenerator()->FindTarget( tgt, { cmStateEnums::TargetDomain::NATIVE }); - if (global_target && !global_target->IsImported()) { - target = global_target; + if (globalTarget && !globalTarget->IsImported()) { + target = globalTarget; } } if (target) { @@ -1364,11 +1364,11 @@ bool HandleImportedRuntimeArtifactsMode(std::vector const& args, cmTarget* target = helper.Makefile->FindTargetToUse(tgt); if (!target || !target->IsImported()) { // If no local target has been found, find it in the global scope. - cmTarget* const global_target = + cmTarget* const globalTarget = helper.Makefile->GetGlobalGenerator()->FindTarget( tgt, { cmStateEnums::TargetDomain::NATIVE }); - if (global_target && global_target->IsImported()) { - target = global_target; + if (globalTarget && globalTarget->IsImported()) { + target = globalTarget; } } if (target) { @@ -1634,21 +1634,21 @@ bool HandleDirectoryMode(std::vector const& args, DoingType }; Doing doing = DoingDirs; - bool in_match_mode = false; + bool inMatchMode = false; bool optional = false; - bool exclude_from_all = false; - bool message_never = false; + bool excludeFromAll = false; + bool messageNever = false; std::vector dirs; cm::optional destination; - std::string permissions_file; - std::string permissions_dir; + std::string permissionsFile; + std::string permissionsDir; std::vector configurations; std::string component = helper.DefaultComponentName; - std::string literal_args; + std::string literalArgs; std::string type; for (unsigned int i = 1; i < args.size(); ++i) { if (args[i] == "DESTINATION") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1657,7 +1657,7 @@ bool HandleDirectoryMode(std::vector const& args, // Switch to setting the destination property. doing = DoingDestination; } else if (args[i] == "TYPE") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1666,7 +1666,7 @@ bool HandleDirectoryMode(std::vector const& args, // Switch to setting the type. doing = DoingType; } else if (args[i] == "OPTIONAL") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1676,44 +1676,44 @@ bool HandleDirectoryMode(std::vector const& args, optional = true; doing = DoingNone; } else if (args[i] == "MESSAGE_NEVER") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; } // Mark the rule as quiet. - message_never = true; + messageNever = true; doing = DoingNone; } else if (args[i] == "PATTERN") { // Switch to a new pattern match rule. doing = DoingPattern; - in_match_mode = true; + inMatchMode = true; } else if (args[i] == "REGEX") { // Switch to a new regex match rule. doing = DoingRegex; - in_match_mode = true; + inMatchMode = true; } else if (args[i] == "EXCLUDE") { // Add this property to the current match rule. - if (!in_match_mode || doing == DoingPattern || doing == DoingRegex) { + if (!inMatchMode || doing == DoingPattern || doing == DoingRegex) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" before a PATTERN or REGEX is given.")); return false; } - literal_args += " EXCLUDE"; + literalArgs += " EXCLUDE"; doing = DoingNone; } else if (args[i] == "PERMISSIONS") { - if (!in_match_mode) { + if (!inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" before a PATTERN or REGEX is given.")); return false; } // Switch to setting the current match permissions property. - literal_args += " PERMISSIONS"; + literalArgs += " PERMISSIONS"; doing = DoingPermsMatch; } else if (args[i] == "FILE_PERMISSIONS") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1722,7 +1722,7 @@ bool HandleDirectoryMode(std::vector const& args, // Switch to setting the file permissions property. doing = DoingPermsFile; } else if (args[i] == "DIRECTORY_PERMISSIONS") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1731,27 +1731,27 @@ bool HandleDirectoryMode(std::vector const& args, // Switch to setting the directory permissions property. doing = DoingPermsDir; } else if (args[i] == "USE_SOURCE_PERMISSIONS") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; } // Add this option literally. - literal_args += " USE_SOURCE_PERMISSIONS"; + literalArgs += " USE_SOURCE_PERMISSIONS"; doing = DoingNone; } else if (args[i] == "FILES_MATCHING") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; } // Add this option literally. - literal_args += " FILES_MATCHING"; + literalArgs += " FILES_MATCHING"; doing = DoingNone; } else if (args[i] == "CONFIGURATIONS") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1760,7 +1760,7 @@ bool HandleDirectoryMode(std::vector const& args, // Switch to setting the configurations property. doing = DoingConfigurations; } else if (args[i] == "COMPONENT") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; @@ -1769,12 +1769,12 @@ bool HandleDirectoryMode(std::vector const& args, // Switch to setting the component property. doing = DoingComponent; } else if (args[i] == "EXCLUDE_FROM_ALL") { - if (in_match_mode) { + if (inMatchMode) { status.SetError(cmStrCat(args[0], " does not allow \"", args[i], "\" after PATTERN or REGEX.")); return false; } - exclude_from_all = true; + excludeFromAll = true; doing = DoingNone; } else if (doing == DoingDirs) { // If the given directory is not a full path, convert it to one by @@ -1833,14 +1833,14 @@ bool HandleDirectoryMode(std::vector const& args, // leading slash and trailing end-of-string in the matched // string to make sure the pattern matches only whole file // names. - literal_args += " REGEX \"/"; + literalArgs += " REGEX \"/"; std::string regex = cmsys::Glob::PatternToRegex(args[i], false); cmSystemTools::ReplaceString(regex, "\\", "\\\\"); - literal_args += regex; - literal_args += "$\""; + literalArgs += regex; + literalArgs += "$\""; doing = DoingNone; } else if (doing == DoingRegex) { - literal_args += " REGEX \""; + literalArgs += " REGEX \""; // Match rules are case-insensitive on some platforms. #if defined(_WIN32) || defined(__APPLE__) std::string regex = cmSystemTools::LowerCase(args[i]); @@ -1848,8 +1848,8 @@ bool HandleDirectoryMode(std::vector const& args, std::string regex = args[i]; #endif cmSystemTools::ReplaceString(regex, "\\", "\\\\"); - literal_args += regex; - literal_args += "\""; + literalArgs += regex; + literalArgs += "\""; doing = DoingNone; } else if (doing == DoingComponent) { component = args[i]; @@ -1857,7 +1857,7 @@ bool HandleDirectoryMode(std::vector const& args, } else if (doing == DoingPermsFile) { // Check the requested permission. if (!cmInstallCommandArguments::CheckPermissions(args[i], - permissions_file)) { + permissionsFile)) { status.SetError(cmStrCat(args[0], " given invalid file permission \"", args[i], "\".")); return false; @@ -1865,15 +1865,14 @@ bool HandleDirectoryMode(std::vector const& args, } else if (doing == DoingPermsDir) { // Check the requested permission. if (!cmInstallCommandArguments::CheckPermissions(args[i], - permissions_dir)) { + permissionsDir)) { status.SetError(cmStrCat( args[0], " given invalid directory permission \"", args[i], "\".")); return false; } } else if (doing == DoingPermsMatch) { // Check the requested permission. - if (!cmInstallCommandArguments::CheckPermissions(args[i], - literal_args)) { + if (!cmInstallCommandArguments::CheckPermissions(args[i], literalArgs)) { status.SetError( cmStrCat(args[0], " given invalid permission \"", args[i], "\".")); return false; @@ -1910,7 +1909,7 @@ bool HandleDirectoryMode(std::vector const& args, } cmInstallGenerator::MessageLevel message = - cmInstallGenerator::SelectMessageLevel(helper.Makefile, message_never); + cmInstallGenerator::SelectMessageLevel(helper.Makefile, messageNever); // Check for an absolute destination. if (cmGeneratorExpression::Find(*destination) == std::string::npos && @@ -1924,8 +1923,8 @@ bool HandleDirectoryMode(std::vector const& args, // Create the directory install generator. helper.Makefile->AddInstallGenerator( cm::make_unique( - dirs, *destination, permissions_file, permissions_dir, configurations, - component, message, exclude_from_all, literal_args, optional, + dirs, *destination, permissionsFile, permissionsDir, configurations, + component, message, excludeFromAll, literalArgs, optional, helper.Makefile->GetBacktrace())); // Tell the global generator about any installation component names @@ -1945,12 +1944,12 @@ bool HandleExportAndroidMKMode(std::vector const& args, cmInstallCommandArguments ica(helper.DefaultComponentName, *helper.Makefile); std::string exp; - std::string name_space; + std::string exportNamespace; bool exportOld = false; std::string filename; ica.Bind("EXPORT_ANDROID_MK"_s, exp); - ica.Bind("NAMESPACE"_s, name_space); + ica.Bind("NAMESPACE"_s, exportNamespace); ica.Bind("EXPORT_LINK_INTERFACE_LIBRARIES"_s, exportOld); ica.Bind("FILE"_s, filename); @@ -2022,7 +2021,7 @@ bool HandleExportAndroidMKMode(std::vector const& args, cm::make_unique( &exportSet, ica.GetDestination(), ica.GetPermissions(), ica.GetConfigurations(), ica.GetComponent(), message, - ica.GetExcludeFromAll(), std::move(fname), std::move(name_space), + ica.GetExcludeFromAll(), std::move(fname), std::move(exportNamespace), helper.Makefile->GetBacktrace())); return true; @@ -2188,17 +2187,17 @@ bool HandleExportMode(std::vector const& args, cmInstallCommandArguments ica(helper.DefaultComponentName, *helper.Makefile); std::string exp; - std::string name_space; + std::string exportNamespace; bool exportOld = false; std::string filename; - std::string cxx_modules_directory; + std::string cxxModulesDirectory; bool exportPackageDependencies = false; ica.Bind("EXPORT"_s, exp); - ica.Bind("NAMESPACE"_s, name_space); + ica.Bind("NAMESPACE"_s, exportNamespace); ica.Bind("EXPORT_LINK_INTERFACE_LIBRARIES"_s, exportOld); ica.Bind("FILE"_s, filename); - ica.Bind("CXX_MODULES_DIRECTORY"_s, cxx_modules_directory); + ica.Bind("CXX_MODULES_DIRECTORY"_s, cxxModulesDirectory); if (cmExperimental::HasSupportEnabled( status.GetMakefile(), @@ -2288,8 +2287,7 @@ bool HandleExportMode(std::vector const& args, cm::optional const directive = MatchExport(pie, exp); if (directive) { if (!HandleMappedPackageInfo(exportSet, *directive, helper, ica, - status, message, - cxx_modules_directory)) { + status, message, cxxModulesDirectory)) { return false; } } @@ -2303,8 +2301,8 @@ bool HandleExportMode(std::vector const& args, cm::make_unique( &exportSet, ica.GetDestination(), ica.GetPermissions(), ica.GetConfigurations(), ica.GetComponent(), message, - ica.GetExcludeFromAll(), std::move(fname), std::move(name_space), - std::move(cxx_modules_directory), exportOld, exportPackageDependencies, + ica.GetExcludeFromAll(), std::move(fname), std::move(exportNamespace), + std::move(cxxModulesDirectory), exportOld, exportPackageDependencies, helper.Makefile->GetBacktrace())); return true; diff --git a/Source/cmInstallCxxModuleBmiGenerator.cxx b/Source/cmInstallCxxModuleBmiGenerator.cxx index 66f39a49a2..99e32cb4fa 100644 --- a/Source/cmInstallCxxModuleBmiGenerator.cxx +++ b/Source/cmInstallCxxModuleBmiGenerator.cxx @@ -14,14 +14,14 @@ #include "cmStringAlgorithms.h" cmInstallCxxModuleBmiGenerator::cmInstallCxxModuleBmiGenerator( - std::string target, std::string const& dest, std::string file_permissions, + std::string target, std::string const& dest, std::string filePermissions, std::vector const& configurations, std::string const& component, - MessageLevel message, bool exclude_from_all, bool optional, + MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace) : cmInstallGenerator(dest, configurations, component, message, - exclude_from_all, false, std::move(backtrace)) + excludeFromAll, false, std::move(backtrace)) , TargetName(std::move(target)) - , FilePermissions(std::move(file_permissions)) + , FilePermissions(std::move(filePermissions)) , Optional(optional) { this->ActionsPerConfig = true; @@ -46,12 +46,12 @@ bool cmInstallCxxModuleBmiGenerator::Compute(cmLocalGenerator* lg) std::string cmInstallCxxModuleBmiGenerator::GetScriptLocation( std::string const& config) const { - char const* config_name = config.c_str(); + char const* configName = config.c_str(); if (config.empty()) { - config_name = "noconfig"; + configName = "noconfig"; } return cmStrCat(this->Target->GetCMFSupportDirectory(), - "/install-cxx-module-bmi-", config_name, ".cmake"); + "/install-cxx-module-bmi-", configName, ".cmake"); } std::string cmInstallCxxModuleBmiGenerator::GetDestination( diff --git a/Source/cmInstallCxxModuleBmiGenerator.h b/Source/cmInstallCxxModuleBmiGenerator.h index b3b5d37e09..28ed2b5951 100644 --- a/Source/cmInstallCxxModuleBmiGenerator.h +++ b/Source/cmInstallCxxModuleBmiGenerator.h @@ -21,9 +21,9 @@ class cmInstallCxxModuleBmiGenerator : public cmInstallGenerator { public: cmInstallCxxModuleBmiGenerator( - std::string target, std::string const& dest, std::string file_permissions, + std::string target, std::string const& dest, std::string filePermissions, std::vector const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, + std::string const& component, MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace); ~cmInstallCxxModuleBmiGenerator() override; diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx index bd62dd372c..96d32ba3e8 100644 --- a/Source/cmInstallDirectoryGenerator.cxx +++ b/Source/cmInstallDirectoryGenerator.cxx @@ -16,16 +16,16 @@ cmInstallDirectoryGenerator::cmInstallDirectoryGenerator( std::vector const& dirs, std::string const& dest, - std::string file_permissions, std::string dir_permissions, + std::string filePermissions, std::string dirPermissions, std::vector const& configurations, std::string const& component, - MessageLevel message, bool exclude_from_all, std::string literal_args, + MessageLevel message, bool excludeFromAll, std::string literalArgs, bool optional, cmListFileBacktrace backtrace) : cmInstallGenerator(dest, configurations, component, message, - exclude_from_all, false, std::move(backtrace)) + excludeFromAll, false, std::move(backtrace)) , Directories(dirs) - , FilePermissions(std::move(file_permissions)) - , DirPermissions(std::move(dir_permissions)) - , LiteralArguments(std::move(literal_args)) + , FilePermissions(std::move(filePermissions)) + , DirPermissions(std::move(dirPermissions)) + , LiteralArguments(std::move(literalArgs)) , Optional(optional) { // We need per-config actions if destination have generator expressions. @@ -107,11 +107,11 @@ void cmInstallDirectoryGenerator::AddDirectoryInstallRule( std::vector const& dirs) { // Write code to install the directories. - char const* no_rename = nullptr; + char const* noRename = nullptr; this->AddInstallRule(os, this->GetDestination(config), cmInstallType_DIRECTORY, dirs, this->Optional, this->FilePermissions.c_str(), - this->DirPermissions.c_str(), no_rename, + this->DirPermissions.c_str(), noRename, this->LiteralArguments.c_str(), indent); } diff --git a/Source/cmInstallDirectoryGenerator.h b/Source/cmInstallDirectoryGenerator.h index b02824ae44..d228f9b5fd 100644 --- a/Source/cmInstallDirectoryGenerator.h +++ b/Source/cmInstallDirectoryGenerator.h @@ -21,10 +21,10 @@ class cmInstallDirectoryGenerator : public cmInstallGenerator public: cmInstallDirectoryGenerator( std::vector const& dirs, std::string const& dest, - std::string file_permissions, std::string dir_permissions, + std::string filePermissions, std::string dirPermissions, std::vector const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, - std::string literal_args, bool optional, cmListFileBacktrace backtrace); + std::string const& component, MessageLevel message, bool excludeFromAll, + std::string literalArgs, bool optional, cmListFileBacktrace backtrace); ~cmInstallDirectoryGenerator() override; bool Compute(cmLocalGenerator* lg) override; diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index 88864390b5..7f2474d2c3 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -122,8 +122,8 @@ void cmInstallExportGenerator::GenerateScriptConfigs(std::ostream& os, std::vector files; for (auto const& i : this->EFGen->GetConfigImportFiles()) { files.push_back(i.second); - std::string config_test = this->CreateConfigTest(i.first); - os << indent << "if(" << config_test << ")\n"; + std::string configTest = this->CreateConfigTest(i.first); + os << indent << "if(" << configTest << ")\n"; this->AddInstallRule(os, this->Destination, cmInstallType_FILES, files, false, this->FilePermissions.c_str(), nullptr, nullptr, nullptr, indent.Next()); @@ -182,8 +182,8 @@ void cmInstallExportGenerator::GenerateScriptConfigs(std::ostream& os, } for (auto const& i : this->EFGen->GetConfigCxxModuleFiles()) { files.push_back(i.second); - std::string config_test = this->CreateConfigTest(i.first); - os << indent << "if(" << config_test << ")\n"; + std::string configTest = this->CreateConfigTest(i.first); + os << indent << "if(" << configTest << ")\n"; this->AddInstallRule(os, cxxModuleDestination, cmInstallType_FILES, files, false, this->FilePermissions.c_str(), nullptr, nullptr, nullptr, indent.Next()); @@ -191,8 +191,8 @@ void cmInstallExportGenerator::GenerateScriptConfigs(std::ostream& os, files.clear(); } for (auto const& i : this->EFGen->GetConfigCxxModuleTargetFiles()) { - std::string config_test = this->CreateConfigTest(i.first); - os << indent << "if(" << config_test << ")\n"; + std::string configTest = this->CreateConfigTest(i.first); + os << indent << "if(" << configTest << ")\n"; this->AddInstallRule(os, cxxModuleDestination, cmInstallType_FILES, i.second, false, this->FilePermissions.c_str(), nullptr, nullptr, nullptr, indent.Next()); diff --git a/Source/cmInstallFileSetGenerator.cxx b/Source/cmInstallFileSetGenerator.cxx index e6e9f031e8..60bacc95ad 100644 --- a/Source/cmInstallFileSetGenerator.cxx +++ b/Source/cmInstallFileSetGenerator.cxx @@ -29,14 +29,14 @@ cmInstallFileSetGenerator::cmInstallFileSetGenerator( std::string targetName, std::string fileSetName, std::string destination, - std::string file_permissions, std::vector const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, + std::string filePermissions, std::vector const& configurations, + std::string const& component, MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace) : cmInstallGenerator(std::move(destination), configurations, component, - message, exclude_from_all, false, std::move(backtrace)) + message, excludeFromAll, false, std::move(backtrace)) , TargetName(std::move(targetName)) , FileSetName(std::move(fileSetName)) - , FilePermissions(std::move(file_permissions)) + , FilePermissions(std::move(filePermissions)) , Optional(optional) { this->ActionsPerConfig = true; diff --git a/Source/cmInstallFileSetGenerator.h b/Source/cmInstallFileSetGenerator.h index b0488fb3d5..85866925a0 100644 --- a/Source/cmInstallFileSetGenerator.h +++ b/Source/cmInstallFileSetGenerator.h @@ -20,10 +20,10 @@ class cmInstallFileSetGenerator : public cmInstallGenerator public: cmInstallFileSetGenerator(std::string targetName, std::string fileSetName, std::string destination, - std::string file_permissions, + std::string filePermissions, std::vector const& configurations, std::string const& component, MessageLevel message, - bool exclude_from_all, bool optional, + bool excludeFromAll, bool optional, cmListFileBacktrace backtrace); ~cmInstallFileSetGenerator() override; diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx index f5613fad28..bc9517a1ea 100644 --- a/Source/cmInstallFilesGenerator.cxx +++ b/Source/cmInstallFilesGenerator.cxx @@ -11,14 +11,14 @@ cmInstallFilesGenerator::cmInstallFilesGenerator( std::vector const& files, std::string const& dest, - bool programs, std::string file_permissions, + bool programs, std::string filePermissions, std::vector const& configurations, std::string const& component, - MessageLevel message, bool exclude_from_all, std::string rename, - bool optional, cmListFileBacktrace backtrace) + MessageLevel message, bool excludeFromAll, std::string rename, bool optional, + cmListFileBacktrace backtrace) : cmInstallGenerator(dest, configurations, component, message, - exclude_from_all, false, std::move(backtrace)) + excludeFromAll, false, std::move(backtrace)) , Files(files) - , FilePermissions(std::move(file_permissions)) + , FilePermissions(std::move(filePermissions)) , Rename(std::move(rename)) , Programs(programs) , Optional(optional) @@ -86,11 +86,11 @@ void cmInstallFilesGenerator::AddFilesInstallRule( std::vector const& files) { // Write code to install the files. - char const* no_dir_permissions = nullptr; + char const* noDirPermissions = nullptr; this->AddInstallRule( os, this->GetDestination(config), (this->Programs ? cmInstallType_PROGRAMS : cmInstallType_FILES), files, - this->Optional, this->FilePermissions.c_str(), no_dir_permissions, + this->Optional, this->FilePermissions.c_str(), noDirPermissions, this->GetRename(config).c_str(), nullptr, indent); } diff --git a/Source/cmInstallFilesGenerator.h b/Source/cmInstallFilesGenerator.h index 5ab2f50163..c8f4842b89 100644 --- a/Source/cmInstallFilesGenerator.h +++ b/Source/cmInstallFilesGenerator.h @@ -21,10 +21,10 @@ class cmInstallFilesGenerator : public cmInstallGenerator public: cmInstallFilesGenerator(std::vector const& files, std::string const& dest, bool programs, - std::string file_permissions, + std::string filePermissions, std::vector const& configurations, std::string const& component, MessageLevel message, - bool exclude_from_all, std::string rename, + bool excludeFromAll, std::string rename, bool optional, cmListFileBacktrace backtrace); ~cmInstallFilesGenerator() override; diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx index 9317f94f5f..585bf80cb2 100644 --- a/Source/cmInstallGenerator.cxx +++ b/Source/cmInstallGenerator.cxx @@ -16,14 +16,14 @@ cmInstallGenerator::cmInstallGenerator( std::string destination, std::vector const& configurations, - std::string component, MessageLevel message, bool exclude_from_all, - bool all_components, cmListFileBacktrace backtrace) + std::string component, MessageLevel message, bool excludeFromAll, + bool allComponents, cmListFileBacktrace backtrace) : cmScriptGenerator("CMAKE_INSTALL_CONFIG_NAME", configurations) , Destination(std::move(destination)) , Component(std::move(component)) , Message(message) - , ExcludeFromAll(exclude_from_all) - , AllComponents(all_components) + , ExcludeFromAll(excludeFromAll) + , AllComponents(allComponents) , Backtrace(std::move(backtrace)) { } @@ -46,10 +46,10 @@ void cmInstallGenerator::CheckCMP0082(bool& haveSubdirectoryInstall, void cmInstallGenerator::AddInstallRule( std::ostream& os, std::string const& dest, cmInstallType type, std::vector const& files, bool optional /* = false */, - char const* permissions_file /* = nullptr */, - char const* permissions_dir /* = nullptr */, - char const* rename /* = nullptr */, char const* literal_args /* = nullptr */, - Indent indent, char const* files_var /* = nullptr */) + char const* permissionsFile /* = nullptr */, + char const* permissionsDir /* = nullptr */, + char const* rename /* = nullptr */, char const* literalArgs /* = nullptr */, + Indent indent, char const* filesVar /* = nullptr */) { // Use the FILE command to install the file. std::string stype; @@ -95,9 +95,8 @@ void cmInstallGenerator::AddInstallRule( } os << "\")\n"; } - if (files_var) { - os << indent << "foreach(_cmake_abs_file IN LISTS " << files_var - << ")\n"; + if (filesVar) { + os << indent << "foreach(_cmake_abs_file IN LISTS " << filesVar << ")\n"; os << indent.Next() << "get_filename_component(_cmake_abs_file_name " "\"${_cmake_abs_file}\" NAME)\n"; @@ -139,11 +138,11 @@ void cmInstallGenerator::AddInstallRule( os << " MESSAGE_NEVER"; break; } - if (permissions_file && *permissions_file) { - os << " PERMISSIONS" << permissions_file; + if (permissionsFile && *permissionsFile) { + os << " PERMISSIONS" << permissionsFile; } - if (permissions_dir && *permissions_dir) { - os << " DIR_PERMISSIONS" << permissions_dir; + if (permissionsDir && *permissionsDir) { + os << " DIR_PERMISSIONS" << permissionsDir; } if (rename && *rename) { os << " RENAME \"" << rename << "\""; @@ -155,25 +154,25 @@ void cmInstallGenerator::AddInstallRule( for (std::string const& f : files) { os << "\n" << indent << " \"" << f << "\""; } - if (files_var) { - os << " ${" << files_var << "}"; + if (filesVar) { + os << " ${" << filesVar << "}"; } os << "\n" << indent << " "; - if (!(literal_args && *literal_args)) { + if (!(literalArgs && *literalArgs)) { os << " "; } } - if (literal_args && *literal_args) { - os << literal_args; + if (literalArgs && *literalArgs) { + os << literalArgs; } os << ")\n"; } std::string cmInstallGenerator::CreateComponentTest( - std::string const& component, bool exclude_from_all, bool all_components) + std::string const& component, bool excludeFromAll, bool allComponents) { - if (all_components) { - if (exclude_from_all) { + if (allComponents) { + if (excludeFromAll) { return "CMAKE_INSTALL_COMPONENT"; } return {}; @@ -182,7 +181,7 @@ std::string cmInstallGenerator::CreateComponentTest( std::string result = "CMAKE_INSTALL_COMPONENT STREQUAL \""; result += component; result += "\""; - if (!exclude_from_all) { + if (!excludeFromAll) { result += " OR NOT CMAKE_INSTALL_COMPONENT"; } @@ -194,12 +193,12 @@ void cmInstallGenerator::GenerateScript(std::ostream& os) // Track indentation. Indent indent; - std::string component_test = this->CreateComponentTest( + std::string componentTest = this->CreateComponentTest( this->Component, this->ExcludeFromAll, this->AllComponents); // Begin this block of installation. - if (!component_test.empty()) { - os << indent << "if(" << component_test << ")\n"; + if (!componentTest.empty()) { + os << indent << "if(" << componentTest << ")\n"; } // Generate the script possibly with per-configuration code. @@ -207,7 +206,7 @@ void cmInstallGenerator::GenerateScript(std::ostream& os) this->AllComponents ? indent : indent.Next()); // End this block of installation. - if (!component_test.empty()) { + if (!componentTest.empty()) { os << indent << "endif()\n\n"; } } diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h index d35a4b6bf0..9a4b68b591 100644 --- a/Source/cmInstallGenerator.h +++ b/Source/cmInstallGenerator.h @@ -34,7 +34,7 @@ public: cmInstallGenerator(std::string destination, std::vector const& configurations, std::string component, MessageLevel message, - bool exclude_from_all, bool all_components, + bool excludeFromAll, bool allComponents, cmListFileBacktrace backtrace); ~cmInstallGenerator() override; @@ -48,10 +48,10 @@ public: void AddInstallRule( std::ostream& os, std::string const& dest, cmInstallType type, std::vector const& files, bool optional = false, - char const* permissions_file = nullptr, - char const* permissions_dir = nullptr, char const* rename = nullptr, - char const* literal_args = nullptr, Indent indent = Indent(), - char const* files_var = nullptr); + char const* permissionsFile = nullptr, + char const* permissionsDir = nullptr, char const* rename = nullptr, + char const* literalArgs = nullptr, Indent indent = Indent(), + char const* filesVar = nullptr); /** Get the install destination as it should appear in the installation script. */ @@ -81,8 +81,8 @@ protected: void GenerateScript(std::ostream& os) override; std::string CreateComponentTest(std::string const& component, - bool exclude_from_all, - bool all_components = false); + bool excludeFromAll, + bool allComponents = false); using TweakMethod = std::function postExcludeFiles, std::string libraryComponent, std::string frameworkComponent, bool noInstallRPath, char const* depsVar, char const* rpathPrefix, std::vector const& configurations, - MessageLevel message, bool exclude_from_all, cmListFileBacktrace backtrace, + MessageLevel message, bool excludeFromAll, cmListFileBacktrace backtrace, cmPolicies::PolicyStatus policyStatusCMP0207) - : cmInstallGenerator("", configurations, "", message, exclude_from_all, - false, std::move(backtrace)) + : cmInstallGenerator("", configurations, "", message, excludeFromAll, false, + std::move(backtrace)) , RuntimeDependencySet(runtimeDependencySet) , Directories(std::move(directories)) , PreIncludeRegexes(std::move(preIncludeRegexes)) diff --git a/Source/cmInstallGetRuntimeDependenciesGenerator.h b/Source/cmInstallGetRuntimeDependenciesGenerator.h index 9670dcf147..413d2b81a0 100644 --- a/Source/cmInstallGetRuntimeDependenciesGenerator.h +++ b/Source/cmInstallGetRuntimeDependenciesGenerator.h @@ -27,7 +27,7 @@ public: std::vector postExcludeFiles, std::string libraryComponent, std::string frameworkComponent, bool noInstallRPath, char const* depsVar, char const* rpathPrefix, std::vector const& configurations, - MessageLevel message, bool exclude_from_all, cmListFileBacktrace backtrace, + MessageLevel message, bool excludeFromAll, cmListFileBacktrace backtrace, cmPolicies::PolicyStatus policyStatusCMP0207); bool Compute(cmLocalGenerator* lg) override; diff --git a/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx b/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx index 9552748cfb..a2ae0ffc17 100644 --- a/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx +++ b/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx @@ -32,14 +32,14 @@ cmsys::RegularExpression const CFBundleRegularExpression( cmInstallImportedRuntimeArtifactsGenerator:: cmInstallImportedRuntimeArtifactsGenerator( std::string targetName, std::string const& dest, - std::string file_permissions, + std::string filePermissions, std::vector const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, + std::string const& component, MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace) : cmInstallGenerator(dest, configurations, component, message, - exclude_from_all, false, std::move(backtrace)) + excludeFromAll, false, std::move(backtrace)) , TargetName(std::move(targetName)) - , FilePermissions(std::move(file_permissions)) + , FilePermissions(std::move(filePermissions)) , Optional(optional) { this->ActionsPerConfig = true; diff --git a/Source/cmInstallImportedRuntimeArtifactsGenerator.h b/Source/cmInstallImportedRuntimeArtifactsGenerator.h index 90c13a8946..411d472ac1 100644 --- a/Source/cmInstallImportedRuntimeArtifactsGenerator.h +++ b/Source/cmInstallImportedRuntimeArtifactsGenerator.h @@ -16,9 +16,9 @@ class cmInstallImportedRuntimeArtifactsGenerator : public cmInstallGenerator public: cmInstallImportedRuntimeArtifactsGenerator( std::string targetName, std::string const& dest, - std::string file_permissions, + std::string filePermissions, std::vector const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, + std::string const& component, MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace = cmListFileBacktrace()); ~cmInstallImportedRuntimeArtifactsGenerator() override = default; diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx index 63f40e2508..0a808b7bd5 100644 --- a/Source/cmInstallProgramsCommand.cxx +++ b/Source/cmInstallProgramsCommand.cxx @@ -48,18 +48,18 @@ bool cmInstallProgramsCommand(std::vector const& args, static void FinalAction(cmMakefile& makefile, std::string const& dest, std::vector const& args) { - bool files_mode = false; + bool filesMode = false; if (!args.empty() && args[0] == "FILES") { - files_mode = true; + filesMode = true; } std::vector files; // two different options - if (args.size() > 1 || files_mode) { + if (args.size() > 1 || filesMode) { // for each argument, get the programs auto s = args.begin(); - if (files_mode) { + if (filesMode) { // Skip the FILES argument in files mode. ++s; } diff --git a/Source/cmInstallRuntimeDependencySetGenerator.cxx b/Source/cmInstallRuntimeDependencySetGenerator.cxx index ec460452f4..53c3429915 100644 --- a/Source/cmInstallRuntimeDependencySetGenerator.cxx +++ b/Source/cmInstallRuntimeDependencySetGenerator.cxx @@ -24,10 +24,10 @@ cmInstallRuntimeDependencySetGenerator::cmInstallRuntimeDependencySetGenerator( std::string installNameDir, bool noInstallName, char const* depsVar, char const* rpathPrefix, char const* tmpVarPrefix, std::string destination, std::vector const& configurations, std::string component, - std::string permissions, MessageLevel message, bool exclude_from_all, + std::string permissions, MessageLevel message, bool excludeFromAll, cmListFileBacktrace backtrace) : cmInstallGenerator(std::move(destination), configurations, - std::move(component), message, exclude_from_all, false, + std::move(component), message, excludeFromAll, false, std::move(backtrace)) , Type(type) , DependencySet(dependencySet) diff --git a/Source/cmInstallRuntimeDependencySetGenerator.h b/Source/cmInstallRuntimeDependencySetGenerator.h index f8a7a4f497..80f4cc328a 100644 --- a/Source/cmInstallRuntimeDependencySetGenerator.h +++ b/Source/cmInstallRuntimeDependencySetGenerator.h @@ -27,7 +27,7 @@ public: std::string installNameDir, bool noInstallName, char const* depsVar, char const* rpathPrefix, char const* tmpVarPrefix, std::string destination, std::vector const& configurations, std::string component, - std::string permissions, MessageLevel message, bool exclude_from_all, + std::string permissions, MessageLevel message, bool excludeFromAll, cmListFileBacktrace backtrace); bool Compute(cmLocalGenerator* lg) override; diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx index a75e924442..0070b6095a 100644 --- a/Source/cmInstallScriptGenerator.cxx +++ b/Source/cmInstallScriptGenerator.cxx @@ -14,9 +14,9 @@ cmInstallScriptGenerator::cmInstallScriptGenerator( std::string script, bool code, std::string const& component, - bool exclude_from_all, bool all_components, cmListFileBacktrace backtrace) + bool excludeFromAll, bool allComponents, cmListFileBacktrace backtrace) : cmInstallGenerator("", std::vector(), component, - MessageDefault, exclude_from_all, all_components, + MessageDefault, excludeFromAll, allComponents, std::move(backtrace)) , Script(std::move(script)) , Code(code) diff --git a/Source/cmInstallScriptGenerator.h b/Source/cmInstallScriptGenerator.h index 104d432572..fe7ca8ff16 100644 --- a/Source/cmInstallScriptGenerator.h +++ b/Source/cmInstallScriptGenerator.h @@ -20,7 +20,7 @@ class cmInstallScriptGenerator : public cmInstallGenerator public: cmInstallScriptGenerator( std::string script, bool code, std::string const& component, - bool exclude_from_all, bool all_components, + bool excludeFromAll, bool allComponents, cmListFileBacktrace backtrace = cmListFileBacktrace()); ~cmInstallScriptGenerator() override; diff --git a/Source/cmInstallScriptHandler.cxx b/Source/cmInstallScriptHandler.cxx index 6a268f9e4c..99a0694f78 100644 --- a/Source/cmInstallScriptHandler.cxx +++ b/Source/cmInstallScriptHandler.cxx @@ -34,86 +34,86 @@ using InstallScript = cmInstallScriptHandler::InstallScript; using InstallScriptRunner = cmInstallScriptHandler::InstallScriptRunner; cmInstallScriptHandler::cmInstallScriptHandler( - std::string _binaryDir, std::vector _components, - std::string _config, std::vector& args) - : components(std::move(_components)) - , binaryDir(std::move(_binaryDir)) + std::string binaryDir, std::vector components, + std::string installConfig, std::vector& args) + : Components(std::move(components)) + , BinaryDir(std::move(binaryDir)) { - if (this->components.empty()) { - this->components.emplace_back(std::string{}); + if (this->Components.empty()) { + this->Components.emplace_back(std::string{}); } std::string const& file = - cmStrCat(this->binaryDir, "/CMakeFiles/InstallScripts.json"); - this->parallel = false; + cmStrCat(this->BinaryDir, "/CMakeFiles/InstallScripts.json"); + this->Parallel = false; auto addScript = [this, &args](std::string script, std::string component, std::string config) -> void { - this->scripts.push_back({ script, config, args }); + this->Scripts.push_back({ script, config, args }); if (!component.empty()) { - this->scripts.back().command.insert( - this->scripts.back().command.end() - 1, + this->Scripts.back().command.insert( + this->Scripts.back().command.end() - 1, cmStrCat("-DCMAKE_INSTALL_COMPONENT=", component)); } if (!config.empty()) { - this->scripts.back().command.insert( - this->scripts.back().command.end() - 1, + this->Scripts.back().command.insert( + this->Scripts.back().command.end() - 1, cmStrCat("-DCMAKE_INSTALL_CONFIG_NAME=", config)); } - this->scripts.back().command.emplace_back(script); - this->directories.push_back(cmSystemTools::GetFilenamePath(script)); + this->Scripts.back().command.emplace_back(script); + this->Directories.push_back(cmSystemTools::GetFilenamePath(script)); }; int compare = 1; if (cmSystemTools::FileExists(file)) { cmSystemTools::FileTimeCompare( - cmStrCat(this->binaryDir, "/CMakeFiles/cmake.check_cache"), file, + cmStrCat(this->BinaryDir, "/CMakeFiles/cmake.check_cache"), file, &compare); } if (compare < 1) { Json::CharReaderBuilder rbuilder; - auto JsonReader = + auto jsonReader = std::unique_ptr(rbuilder.newCharReader()); std::vector content; Json::Value value; cmJSONState state(file, &value); - this->parallel = value["Parallel"].asBool(); - if (this->parallel) { + this->Parallel = value["Parallel"].asBool(); + if (this->Parallel) { args.insert(args.end() - 1, "-DCMAKE_INSTALL_LOCAL_ONLY=1"); } - if (_config.empty() && value.isMember("Configs")) { + if (installConfig.empty() && value.isMember("Configs")) { for (auto const& config : value["Configs"]) { - this->configs.push_back(config.asCString()); + this->Configs.push_back(config.asCString()); } } else { - this->configs.push_back(_config); + this->Configs.push_back(installConfig); } for (auto const& script : value["InstallScripts"]) { - for (auto const& component : components) { - for (auto const& config : configs) { + for (auto const& component : Components) { + for (auto const& config : Configs) { addScript(script.asCString(), component, config); } } - if (!this->parallel) { + if (!this->Parallel) { break; } } } else { - for (auto const& component : components) { - addScript(cmStrCat(this->binaryDir, "/cmake_install.cmake"), component, - _config); + for (auto const& component : Components) { + addScript(cmStrCat(this->BinaryDir, "/cmake_install.cmake"), component, + installConfig); } } } bool cmInstallScriptHandler::IsParallel() { - return this->parallel; + return this->Parallel; } std::vector cmInstallScriptHandler::GetScripts() const { - return this->scripts; + return this->Scripts; } int cmInstallScriptHandler::Install(unsigned int j, @@ -122,27 +122,27 @@ int cmInstallScriptHandler::Install(unsigned int j, cm::uv_loop_ptr loop; loop.init(); std::vector runners; - runners.reserve(this->scripts.size()); + runners.reserve(this->Scripts.size()); - std::vector instrument_arg; + std::vector instrumentArg; if (instrumentation.HasQuery()) { - instrument_arg = { cmSystemTools::GetCTestCommand(), - "--instrument", - "--command-type", - "install", - "--build-dir", - this->binaryDir, - "--config", - "", - "--" }; + instrumentArg = { cmSystemTools::GetCTestCommand(), + "--instrument", + "--command-type", + "install", + "--build-dir", + this->BinaryDir, + "--config", + "", + "--" }; } - for (auto& script : this->scripts) { - if (!instrument_arg.empty()) { - instrument_arg[7] = script.config; // --config + for (auto& script : this->Scripts) { + if (!instrumentArg.empty()) { + instrumentArg[7] = script.config; // --config } - script.command.insert(script.command.begin(), instrument_arg.begin(), - instrument_arg.end()); + script.command.insert(script.command.begin(), instrumentArg.begin(), + instrumentArg.end()); runners.emplace_back(script); } std::size_t working = 0; @@ -168,28 +168,28 @@ int cmInstallScriptHandler::Install(unsigned int j, uv_run(loop, UV_RUN_DEFAULT); // Write install manifest - std::string install_manifest; - for (auto const& component : this->components) { + std::string installManifest; + for (auto const& component : this->Components) { if (component.empty()) { - install_manifest = "install_manifest.txt"; + installManifest = "install_manifest.txt"; } else { cmsys::RegularExpression regEntry; if (regEntry.compile("^[a-zA-Z0-9_.+-]+$") && regEntry.find(component)) { - install_manifest = cmStrCat("install_manifest_", component, ".txt"); + installManifest = cmStrCat("install_manifest_", component, ".txt"); } else { cmCryptoHash md5(cmCryptoHash::AlgoMD5); md5.Initialize(); - install_manifest = + installManifest = cmStrCat("install_manifest_", md5.HashString(component), ".txt"); } } cmGeneratedFileStream fout( - cmStrCat(this->binaryDir, '/', install_manifest)); + cmStrCat(this->BinaryDir, '/', installManifest)); fout.SetCopyIfDifferent(true); - for (auto const& dir : this->directories) { - auto local_manifest = cmStrCat(dir, "/install_local_manifest.txt"); - if (cmSystemTools::FileExists(local_manifest)) { - cmsys::ifstream fin(local_manifest.c_str()); + for (auto const& dir : this->Directories) { + auto localManifest = cmStrCat(dir, "/install_local_manifest.txt"); + if (cmSystemTools::FileExists(localManifest)) { + cmsys::ifstream fin(localManifest.c_str()); std::string line; while (std::getline(fin, line)) { fout << line << "\n"; @@ -202,34 +202,34 @@ int cmInstallScriptHandler::Install(unsigned int j, InstallScriptRunner::InstallScriptRunner(InstallScript const& script) { - this->name = cmSystemTools::RelativePath( + this->Name = cmSystemTools::RelativePath( cmSystemTools::GetLogicalWorkingDirectory(), script.path); - this->command = script.command; + this->Command = script.command; } void InstallScriptRunner::start(cm::uv_loop_ptr& loop, std::function callback) { cmUVProcessChainBuilder builder; - builder.AddCommand(this->command) + builder.AddCommand(this->Command) .SetExternalLoop(*loop) .SetMergedBuiltinStreams(); - this->chain = cm::make_unique(builder.Start()); - this->streamHandler = cmUVStreamRead( - this->chain->OutputStream(), + this->Chain = cm::make_unique(builder.Start()); + this->StreamHandler = cmUVStreamRead( + this->Chain->OutputStream(), [this](std::vector data) { std::string strdata; cmProcessOutput(cmProcessOutput::Auto) .DecodeText(data.data(), data.size(), strdata); - this->output.push_back(strdata); + this->Output.push_back(strdata); }, std::move(callback)); } void InstallScriptRunner::printResult(std::size_t n, std::size_t total) { - cmSystemTools::Stdout(cmStrCat('[', n, '/', total, "] ", this->name, '\n')); - for (auto const& line : this->output) { + cmSystemTools::Stdout(cmStrCat('[', n, '/', total, "] ", this->Name, '\n')); + for (auto const& line : this->Output) { cmSystemTools::Stdout(line); } } diff --git a/Source/cmInstallScriptHandler.h b/Source/cmInstallScriptHandler.h index 3fcfac0e37..9ab8f8e0fc 100644 --- a/Source/cmInstallScriptHandler.h +++ b/Source/cmInstallScriptHandler.h @@ -40,18 +40,18 @@ public: void printResult(std::size_t n, std::size_t total); private: - std::vector command; - std::vector output; - std::string name; - std::unique_ptr chain; - std::unique_ptr streamHandler; + std::vector Command; + std::vector Output; + std::string Name; + std::unique_ptr Chain; + std::unique_ptr StreamHandler; }; private: - std::vector scripts; - std::vector configs; - std::vector directories; - std::vector components; - std::string binaryDir; - bool parallel; + std::vector Scripts; + std::vector Configs; + std::vector Directories; + std::vector Components; + std::string BinaryDir; + bool Parallel; }; diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index e2e7924b35..e38b296142 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -128,13 +128,13 @@ void computeFilesToInstall( cmInstallTargetGenerator::cmInstallTargetGenerator( std::string targetName, std::string const& dest, bool implib, - std::string file_permissions, std::vector const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, + std::string filePermissions, std::vector const& configurations, + std::string const& component, MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace) : cmInstallGenerator(dest, configurations, component, message, - exclude_from_all, false, std::move(backtrace)) + excludeFromAll, false, std::move(backtrace)) , TargetName(std::move(targetName)) - , FilePermissions(std::move(file_permissions)) + , FilePermissions(std::move(filePermissions)) , ImportLibrary(implib) , Optional(optional) { @@ -177,9 +177,9 @@ void cmInstallTargetGenerator::GenerateScriptForConfig( // Write code to install the target file. char const* no_dir_permissions = nullptr; bool optional = this->Optional || this->ImportLibrary; - std::string literal_args; + std::string literalArgs; if (files.UseSourcePermissions) { - literal_args += " USE_SOURCE_PERMISSIONS"; + literalArgs += " USE_SOURCE_PERMISSIONS"; } if (files.Rename) { if (files.From.size() != files.To.size()) { @@ -199,16 +199,16 @@ void cmInstallTargetGenerator::GenerateScriptForConfig( } this->AddInstallRule(os, dest, files.Type, FileNames, optional, this->FilePermissions.c_str(), no_dir_permissions, - files.To[i].c_str(), literal_args.c_str(), indent); + files.To[i].c_str(), literalArgs.c_str(), indent); } } else { char const* no_rename = nullptr; if (!files.FromDir.empty()) { - literal_args += " FILES_FROM_DIR \"" + files.FromDir + "\""; + literalArgs += " FILES_FROM_DIR \"" + files.FromDir + "\""; } this->AddInstallRule(os, dest, files.Type, files.From, optional, this->FilePermissions.c_str(), no_dir_permissions, - no_rename, literal_args.c_str(), indent); + no_rename, literalArgs.c_str(), indent); } // Add post-installation tweaks. diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h index 7421d0d299..dd1a596ff4 100644 --- a/Source/cmInstallTargetGenerator.h +++ b/Source/cmInstallTargetGenerator.h @@ -22,9 +22,9 @@ class cmInstallTargetGenerator : public cmInstallGenerator public: cmInstallTargetGenerator( std::string targetName, std::string const& dest, bool implib, - std::string file_permissions, + std::string filePermissions, std::vector const& configurations, - std::string const& component, MessageLevel message, bool exclude_from_all, + std::string const& component, MessageLevel message, bool excludeFromAll, bool optional, cmListFileBacktrace backtrace = cmListFileBacktrace()); ~cmInstallTargetGenerator() override; diff --git a/Source/cmInstallTargetsCommand.cxx b/Source/cmInstallTargetsCommand.cxx index 66d40b0f25..6b184103f2 100644 --- a/Source/cmInstallTargetsCommand.cxx +++ b/Source/cmInstallTargetsCommand.cxx @@ -26,7 +26,7 @@ bool cmInstallTargetsCommand(std::vector const& args, cmMakefile::cmTargetMap& tgts = mf.GetTargets(); auto s = args.begin(); ++s; - std::string runtime_dir = "/bin"; + std::string runtimeDir = "/bin"; for (; s != args.end(); ++s) { if (*s == "RUNTIME_DIRECTORY") { ++s; @@ -36,12 +36,12 @@ bool cmInstallTargetsCommand(std::vector const& args, return false; } - runtime_dir = *s; + runtimeDir = *s; } else { auto ti = tgts.find(*s); if (ti != tgts.end()) { ti->second.SetInstallPath(args[0]); - ti->second.SetRuntimeInstallPath(runtime_dir); + ti->second.SetRuntimeInstallPath(runtimeDir); ti->second.SetHaveInstallRule(true); } else { std::string str = "Cannot find target: \"" + *s + "\" to install.";