From 23779057fdb9b67ad5f1cc3391e2198be0c2c693 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 15 May 2025 18:27:13 +0200 Subject: [PATCH] cmStrCat: combine neighboring arguments where possible Found using the `cmstrcat-adjacent-literals` rule for `ast-grep`. --- Source/CursesDialog/cmCursesMainForm.cxx | 7 +-- Source/cmAddLibraryCommand.cxx | 2 +- Source/cmAddSubDirectoryCommand.cxx | 5 +- Source/cmCMakeLanguageCommand.cxx | 2 +- Source/cmCMakePkgConfigCommand.cxx | 6 +-- Source/cmComputeLinkDepends.cxx | 7 +-- Source/cmExperimental.cxx | 3 +- Source/cmExportCommand.cxx | 3 +- Source/cmFileCommand.cxx | 18 ++++--- Source/cmForEachCommand.cxx | 2 +- Source/cmGeneratorTarget.cxx | 3 +- Source/cmGeneratorTarget_Link.cxx | 5 +- Source/cmGlobalGhsMultiGenerator.cxx | 13 +++-- Source/cmGlobalVisualStudio10Generator.cxx | 6 ++- Source/cmGlobalXCodeGenerator.cxx | 2 +- Source/cmInstallCommand.cxx | 3 +- Source/cmNinjaTargetGenerator.cxx | 9 ++-- Source/cmPolicies.cxx | 2 +- Source/cmQtAutoGenGlobalInitializer.cxx | 4 +- Source/cmQtAutoGenInitializer.cxx | 12 +++-- Source/cmQtAutoMocUic.cxx | 6 +-- Source/cmQtAutoRcc.cxx | 5 +- Source/cmReturnCommand.cxx | 3 +- Source/cmTargetLinkLibrariesCommand.cxx | 2 +- Source/cmVisualStudio10TargetGenerator.cxx | 2 +- Source/cmake.cxx | 57 +++++++++++++--------- 26 files changed, 112 insertions(+), 77 deletions(-) diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 7b223dc21a..8ca456d139 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -848,9 +848,10 @@ void cmCursesMainForm::HandleInput() curField, "HELPSTRING"); } if (helpString) { - this->HelpMessage[1] = - cmStrCat("Current option is: ", curField, '\n', - "Help string for this option is: ", *helpString, '\n'); + this->HelpMessage[1] = cmStrCat("Current option is: ", curField, + "\n" + "Help string for this option is: ", + *helpString, '\n'); } else { this->HelpMessage[1] = ""; } diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 67ec3b93cf..842eb3be35 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -237,7 +237,7 @@ bool cmAddLibraryCommand(std::vector const& args, "ADD_LIBRARY called with ", (type == cmStateEnums::SHARED_LIBRARY ? "SHARED" : "MODULE"), " option but the target platform does not support dynamic " - "linking. ", + "linking. " "Building a STATIC library instead. This may lead to problems.")); CM_FALLTHROUGH; case cmPolicies::OLD: diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 06911825c3..db052d6932 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -77,8 +77,9 @@ bool cmAddSubDirectoryCommand(std::vector const& args, if (!cmSystemTools::IsSubDirectory(srcPath, mf.GetCurrentSourceDirectory())) { status.SetError( - cmStrCat("not given a binary directory but the given source ", - "directory \"", srcPath, "\" is not a subdirectory of \"", + cmStrCat("not given a binary directory but the given source " + "directory \"", + srcPath, "\" is not a subdirectory of \"", mf.GetCurrentSourceDirectory(), "\". When specifying an " "out-of-tree source a binary directory must be explicitly " diff --git a/Source/cmCMakeLanguageCommand.cxx b/Source/cmCMakeLanguageCommand.cxx index d1ec9cfa1b..18fe20e525 100644 --- a/Source/cmCMakeLanguageCommand.cxx +++ b/Source/cmCMakeLanguageCommand.cxx @@ -467,7 +467,7 @@ bool cmCMakeLanguageCommand(std::vector const& args, if (!defer.Directory) { return FatalError(status, cmStrCat("DEFER DIRECTORY:\n "_s, dir, - "\nis not known. "_s, + "\nis not known. " "It may not have been processed yet."_s)); } } else if (expArgs[expArg] == "ID"_s) { diff --git a/Source/cmCMakePkgConfigCommand.cxx b/Source/cmCMakePkgConfigCommand.cxx index 24676d771a..e2aecb79b0 100644 --- a/Source/cmCMakePkgConfigCommand.cxx +++ b/Source/cmCMakePkgConfigCommand.cxx @@ -626,7 +626,7 @@ cm::optional ImportPackage( if (!cmPkgConfigResolver::CheckVersion(req.ver, ver)) { warn_or_error(cmStrCat("Package '", package, "' version '", ver, "' does not meet version requirement '", - req.ver.string(), "' ", "of '", req.parent, "'"), + req.ver.string(), "' of '", req.parent, "'"), imEnv); return {}; } @@ -856,7 +856,7 @@ bool CheckPackageDependencies( if (!cmPkgConfigResolver::CheckVersion(dep.VerReq, *ver)) { warn_or_error(cmStrCat("Package '", dep.Name, "' version '", *ver, "' does not meet version requirement '", - dep.VerReq.string(), "' ", "of '", name, "'"), + dep.VerReq.string(), "' of '", name, "'"), imEnv); return false; } @@ -869,7 +869,7 @@ bool CheckPackageDependencies( if (!cmPkgConfigResolver::CheckVersion(dep.VerReq, ver)) { warn_or_error(cmStrCat("Package '", dep.Name, "' version '", ver, "' does not meet version requirement '", - dep.VerReq.string(), "' ", "of '", name, "'"), + dep.VerReq.string(), "' of '", name, "'"), imEnv); return false; } diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 966952429c..ed23958f16 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -1179,8 +1179,8 @@ void cmComputeLinkDepends::AddLinkEntries( cmStrCat("Impossible to link target '", this->Target->GetName(), "' because the link item '", entry.Item.Value, "', specified with the group feature '", currentFeature, - '\'', ", has already occurred with the feature '", - groupFeature, '\'', ", which is not allowed."), + "', has already occurred with the feature '", + groupFeature, "', which is not allowed."), this->Target->GetBacktrace()); continue; } @@ -1203,7 +1203,8 @@ void cmComputeLinkDepends::AddLinkEntries( cmStrCat("Impossible to link target '", this->Target->GetName(), "' because the link item '", entry.Item.Value, "' is specified with the features '", itemFeature, - "' and '", entry.Feature, "'", + "' and '", entry.Feature, + "'" ", and both have an 'OVERRIDE' attribute that overrides " "the other. Such cycles are not allowed."), this->Target->GetBacktrace()); diff --git a/Source/cmExperimental.cxx b/Source/cmExperimental.cxx index 91d147095f..fcd2d60ebc 100644 --- a/Source/cmExperimental.cxx +++ b/Source/cmExperimental.cxx @@ -125,7 +125,8 @@ bool cmExperimental::HasSupportEnabled(cmMakefile const& mf, Feature f) mf.IssueMessage( MessageType::AUTHOR_WARNING, cmStrCat( - data.Variable, " is set to incorrect value\n ", value, '\n', + data.Variable, " is set to incorrect value\n ", value, + "\n" "See 'Help/dev/experimental.rst' in the source tree of this " "version of CMake for documentation of the experimental feature " "and the corresponding activation value. This project's code " diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index dc82bbc7cb..6225bfc629 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -407,7 +407,8 @@ bool cmExportCommand(std::vector const& args, case cmPolicies::WARN: mf.IssueMessage( MessageType::AUTHOR_WARNING, - cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0103), '\n', + cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0103), + "\n" "export() command already specified for the file\n ", arguments.Filename, "\nDid you miss 'APPEND' keyword?")); CM_FALLTHROUGH; diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 03e17d4436..3679f4e944 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -417,7 +417,8 @@ bool HandleStringsCommand(std::vector const& args, "CMAKE_POLICY_WARNING_CMP0159")) { status.GetMakefile().IssueMessage( MessageType::AUTHOR_WARNING, - cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0159), '\n', + cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0159), + "\n" "For compatibility, CMake is leaving CMAKE_MATCH_ " "unchanged.")); } @@ -2131,8 +2132,9 @@ bool HandleDownloadCommand(std::vector const& args, if (!file.empty()) { fout.open(file.c_str(), std::ios::binary); if (!fout) { - status.SetError(cmStrCat("DOWNLOAD cannot open file for write\n", - " file: \"", file, '"')); + status.SetError(cmStrCat("DOWNLOAD cannot open file for write\n" + " file: \"", + file, '"')); return false; } } @@ -2330,8 +2332,9 @@ bool HandleDownloadCommand(std::vector const& args, std::string actualHash = hash->HashFile(file); if (actualHash.empty()) { - status.SetError(cmStrCat("DOWNLOAD cannot compute hash on download\n", - " for file: \"", file, '"')); + status.SetError(cmStrCat("DOWNLOAD cannot compute hash on download\n" + " for file: \"", + file, '"')); return false; } @@ -2990,8 +2993,9 @@ bool HandleLockCommand(std::vector const& args, } else { status.GetMakefile().IssueMessage( MessageType::FATAL_ERROR, - cmStrCat("expected DIRECTORY, RELEASE, GUARD, RESULT_VARIABLE or ", - "TIMEOUT\nbut got: \"", args[i], "\".")); + cmStrCat("expected DIRECTORY, RELEASE, GUARD, RESULT_VARIABLE or " + "TIMEOUT\nbut got: \"", + args[i], "\".")); return false; } } diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 83a6abf49f..96867e2658 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -357,7 +357,7 @@ bool HandleInMode(std::vector const& args, } else { makefile.IssueMessage(MessageType::FATAL_ERROR, - cmStrCat("Unknown argument:\n", " ", arg, '\n')); + cmStrCat("Unknown argument:\n ", arg, '\n')); return true; } } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 2a4f347d1d..c0d3e081c1 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -5770,7 +5770,8 @@ void cmGeneratorTarget::CheckCxxModuleStatus(std::string const& config) const cmStrCat("The target named \"", this->GetName(), "\" has C++ sources that may use modules, but modules are not " "supported by this generator:\n ", - this->GetGlobalGenerator()->GetName(), '\n', + this->GetGlobalGenerator()->GetName(), + "\n" "Modules are supported only by Ninja, Ninja Multi-Config, " "and Visual Studio generators for VS 17.4 and newer. " "See the cmake-cxxmodules(7) manual for details. " diff --git a/Source/cmGeneratorTarget_Link.cxx b/Source/cmGeneratorTarget_Link.cxx index f0e527caaa..39517553a8 100644 --- a/Source/cmGeneratorTarget_Link.cxx +++ b/Source/cmGeneratorTarget_Link.cxx @@ -450,9 +450,8 @@ bool cmGeneratorTarget::VerifyLinkItemColons(LinkItemRole role, e = cmStrCat(e, "The link interface of target \"", this->GetName(), "\" contains"); } - e = - cmStrCat(e, ":\n ", item.AsStr(), "\n", "but the target was not found. ", - missingTargetPossibleReasons); + e = cmStrCat(e, ":\n ", item.AsStr(), "\nbut the target was not found. ", + missingTargetPossibleReasons); cmListFileBacktrace backtrace = item.Backtrace; if (backtrace.Empty()) { backtrace = this->GetBacktrace(); diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index 1b52a11e0f..ca9e104539 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -101,11 +101,14 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts, /* check if the toolset changed from last generate */ if (cmNonempty(prevTool) && !cmSystemTools::ComparePath(gbuild, *prevTool)) { - std::string const& e = cmStrCat( - "toolset build tool: ", gbuild, '\n', - "Does not match the previously used build tool: ", *prevTool, '\n', - "Either remove the CMakeCache.txt file and CMakeFiles " - "directory or choose a different binary directory."); + std::string const& e = + cmStrCat("toolset build tool: ", gbuild, + "\n" + "Does not match the previously used build tool: ", + *prevTool, + "\n" + "Either remove the CMakeCache.txt file and CMakeFiles " + "directory or choose a different binary directory."); mf->IssueMessage(MessageType::FATAL_ERROR, e); return false; } diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 688fbd7278..10e8c7f453 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -297,8 +297,10 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset( this->GetPlatformToolsetString(), ",version=", this->GeneratorToolsetVersion, "\n" - "has multiple matches installed at\n", - " ", auxProps, "\n", + "has multiple matches installed at\n" + " ", + auxProps, + "\n" "The toolset and version specification must resolve \n" "to a single installed toolset")); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 7175ac14d8..a076bb8862 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2264,7 +2264,7 @@ void cmGlobalXCodeGenerator::AddCommandsToBuildPhase( cdir = cmSystemTools::ConvertToOutputPath(cdir); std::string makecmd = cmStrCat( "make -C ", cdir, " -f ", cmSystemTools::ConvertToOutputPath(makefile), - "$CONFIGURATION", " OBJDIR=$(basename \"$OBJECT_FILE_DIR_normal\") all"); + "$CONFIGURATION OBJDIR=$(basename \"$OBJECT_FILE_DIR_normal\") all"); buildphase->AddAttribute("shellScript", this->CreateString(makecmd)); buildphase->AddAttribute("showEnvVarsInLog", this->CreateString("0")); } diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index d65d8849d7..2e037d41f9 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -1604,7 +1604,8 @@ bool HandleFilesMode(std::vector const& args, if (gg->IsExportedTargetsFile(file)) { helper.Makefile->IssueMessage( MessageType::FATAL_ERROR, - cmStrCat("The file\n ", file, '\n', + cmStrCat("The file\n ", file, + "\n" "was generated by the export() command. " "It may not be installed with the install() command. " "Use the install(EXPORT) mechanism instead. " diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 8d936525b0..f6a547b77a 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -594,8 +594,10 @@ std::string GetScanCommand( cm::optional srcOrigFile = cm::nullopt) { return cmStrCat(cmakeCmd, " -E cmake_ninja_depends --tdi=", tdi, - " --lang=", lang, " --src=", srcFile, " --out=$out", - " --dep=$DEP_FILE --obj=$OBJ_FILE --ddi=", ddiFile, + " --lang=", lang, " --src=", srcFile, + " --out=$out" + " --dep=$DEP_FILE --obj=$OBJ_FILE --ddi=", + ddiFile, srcOrigFile ? cmStrCat(" --src-orig=", *srcOrigFile) : ""); } @@ -1299,7 +1301,8 @@ void cmNinjaTargetGenerator::GenerateSwiftOutputFileMap( }(); std::string mapFilePath = - cmStrCat(this->GeneratorTarget->GetSupportDirectory(), '/', config, '/', + cmStrCat(this->GeneratorTarget->GetSupportDirectory(), '/', config, + "/" "output-file-map.json"); // build the global target dependencies diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 8e16d51866..45838630b3 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -225,7 +225,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, MessageType::FATAL_ERROR, cmStrCat("An attempt was made to set the policy version of CMake to \"", version_min, - "\" which is greater than this version of CMake. ", + "\" which is greater than this version of CMake. " "This is not allowed because the greater version may have new " "policies not known to this CMake. " "You may need a newer CMake version to build this project.")); diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx index 7b41d912e4..6514f80110 100644 --- a/Source/cmQtAutoGenGlobalInitializer.cxx +++ b/Source/cmQtAutoGenGlobalInitializer.cxx @@ -143,8 +143,8 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer( "AUTOGEN: No valid Qt version found for target ", target->GetName(), ". ", cmQtAutoGen::Tools(mocDisabled, uicDisabled, rccDisabled), - " disabled. Consider adding:\n", " find_package(Qt", version, - " COMPONENTS ", component, ")\n", "to your CMakeLists.txt file."); + " disabled. Consider adding:\n find_package(Qt", version, + " COMPONENTS ", component, ")\nto your CMakeLists.txt file."); target->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, msg); } if (mocIsValid || uicIsValid || rccIsValid) { diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 2e42602eca..343c518562 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1166,7 +1166,8 @@ bool cmQtAutoGenInitializer::InitScanFiles() this->Makefile->IssueMessage( MessageType::AUTHOR_WARNING, cmStrCat( - cmPolicies::GetPolicyWarning(cmPolicies::CMP0071), '\n', + cmPolicies::GetPolicyWarning(cmPolicies::CMP0071), + "\n" "For compatibility, CMake is excluding the GENERATED source " "file(s):\n", files, "from processing by ", @@ -1197,9 +1198,10 @@ bool cmQtAutoGenInitializer::InitScanFiles() this->Makefile->IssueMessage( MessageType::AUTHOR_WARNING, cmStrCat( - cmPolicies::GetPolicyWarning(cmPolicies::CMP0100), '\n', - "For compatibility, CMake is excluding the header file(s):\n", files, - "from processing by ", + cmPolicies::GetPolicyWarning(cmPolicies::CMP0100), + "\n" + "For compatibility, CMake is excluding the header file(s):\n", + files, "from processing by ", cmQtAutoGen::Tools(this->Moc.Enabled, this->Uic.Enabled, false), ". If any of the files should be processed, set CMP0100 to NEW. " "If any of the files should not be processed, " @@ -1233,7 +1235,7 @@ bool cmQtAutoGenInitializer::InitScanFiles() if (this->MultiConfig && !this->GlobalGen->IsXcode() && this->UseBetterGraph) { qrc.OutputFile = cmStrCat(this->Dir.Build, '/', qrc.QrcPathChecksum, - "_$", "/qrc_", qrc.QrcName, ".cpp"); + "_$/qrc_", qrc.QrcName, ".cpp"); } else { qrc.OutputFile = cmStrCat(this->Dir.Build, '/', qrc.QrcPathChecksum, "/qrc_", qrc.QrcName, ".cpp"); diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx index 6d524ef975..8561425e56 100644 --- a/Source/cmQtAutoMocUic.cxx +++ b/Source/cmQtAutoMocUic.cxx @@ -1302,7 +1302,7 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::EvalSource( ".\nRunning moc on the source\n ", this->MessagePath(sourceFile.FileName), "!\nBetter include ", this->MessagePath(sourceBase + ".moc"), - " for compatibility with regular mode.\n", + " for compatibility with regular mode.\n" "This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n")); // Create mapping @@ -1370,7 +1370,7 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::EvalSource( " macro.\nRunning moc on the header\n ", this->MessagePath(headerHandle->FileName), "!\nBetter include ", this->MessagePath("moc_" + incKey.Base + ".cpp"), - " for a compatibility with regular mode.\n", + " for a compatibility with regular mode.\n" "This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n")); } else { this->Log().Warning( @@ -1382,7 +1382,7 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::EvalSource( ".\nRunning moc on the header\n ", this->MessagePath(headerHandle->FileName), "!\nBetter include ", this->MessagePath("moc_" + incKey.Base + ".cpp"), - " for compatibility with regular mode.\n", + " for compatibility with regular mode.\n" "This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n")); } // Create mapping diff --git a/Source/cmQtAutoRcc.cxx b/Source/cmQtAutoRcc.cxx index db72f92f1b..6c3ddc602e 100644 --- a/Source/cmQtAutoRcc.cxx +++ b/Source/cmQtAutoRcc.cxx @@ -511,8 +511,9 @@ bool cmQtAutoRccT::GenerateWrapper() if (this->IsMultiConfig()) { // Wrapper file content std::string content = - cmStrCat("// This is an autogenerated configuration wrapper file.\n", - "// Changes will be overwritten.\n", "#include <", + cmStrCat("// This is an autogenerated configuration wrapper file.\n" + "// Changes will be overwritten.\n" + "#include <", this->MultiConfigOutput(), ">\n"); // Compare with existing file content diff --git a/Source/cmReturnCommand.cxx b/Source/cmReturnCommand.cxx index 7e475ebe93..c0d74912f7 100644 --- a/Source/cmReturnCommand.cxx +++ b/Source/cmReturnCommand.cxx @@ -22,7 +22,8 @@ bool cmReturnCommand(std::vector const& args, status.GetMakefile().IssueMessage( MessageType::AUTHOR_WARNING, cmStrCat( - cmPolicies::GetPolicyWarning(cmPolicies::CMP0140), '\n', + cmPolicies::GetPolicyWarning(cmPolicies::CMP0140), + "\n" "return() checks its arguments when the policy is set to NEW. " "Since the policy is not set the OLD behavior will be used so " "the arguments will be ignored.")); diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index be9fc8f6c6..275fa7655a 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -429,7 +429,7 @@ bool TLL::HandleLibrary(ProcessingState currentProcessingState, "Target \"", lib, "\" of type ", cmState::GetTargetTypeName(tgt->GetType()), " may not be linked into another target. One may link only to " - "INTERFACE, OBJECT, STATIC or SHARED libraries, or to ", + "INTERFACE, OBJECT, STATIC or SHARED libraries, or to " "executables with the ENABLE_EXPORTS property set.")); } diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index c5bbad23eb..e92c9f4d86 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -3450,7 +3450,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( if (configName == this->Configurations[0]) { std::string message = cmStrCat("For the target \"", this->GeneratorTarget->GetName(), - "\" the /clr compiler flag was added manually. ", + "\" the /clr compiler flag was added manually. " "Set usage of C++/CLI by setting COMMON_LANGUAGE_RUNTIME " "target property."); this->Makefile->IssueMessage(MessageType::WARNING, message); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2cbbd2a381..a85847fe36 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2511,11 +2511,14 @@ int cmake::ActualConfigure() cmValue genName = this->State->GetInitializedCacheValue("CMAKE_GENERATOR"); if (genName) { if (!this->GlobalGenerator->MatchesGeneratorName(*genName)) { - std::string message = cmStrCat( - "Error: generator : ", this->GlobalGenerator->GetName(), '\n', - "Does not match the generator used previously: ", *genName, '\n', - "Either remove the CMakeCache.txt file and CMakeFiles " - "directory or choose a different binary directory."); + std::string message = + cmStrCat("Error: generator : ", this->GlobalGenerator->GetName(), + "\n" + "Does not match the generator used previously: ", + *genName, + "\n" + "Either remove the CMakeCache.txt file and CMakeFiles " + "directory or choose a different binary directory."); cmSystemTools::Error(message); return -2; } @@ -2541,11 +2544,14 @@ int cmake::ActualConfigure() if (cmValue instance = this->State->GetInitializedCacheValue("CMAKE_GENERATOR_INSTANCE")) { if (this->GeneratorInstanceSet && this->GeneratorInstance != *instance) { - std::string message = cmStrCat( - "Error: generator instance: ", this->GeneratorInstance, '\n', - "Does not match the instance used previously: ", *instance, '\n', - "Either remove the CMakeCache.txt file and CMakeFiles " - "directory or choose a different binary directory."); + std::string message = + cmStrCat("Error: generator instance: ", this->GeneratorInstance, + "\n" + "Does not match the instance used previously: ", + *instance, + "\n" + "Either remove the CMakeCache.txt file and CMakeFiles " + "directory or choose a different binary directory."); cmSystemTools::Error(message); return -2; } @@ -2559,11 +2565,14 @@ int cmake::ActualConfigure() this->State->GetInitializedCacheValue("CMAKE_GENERATOR_PLATFORM")) { if (this->GeneratorPlatformSet && this->GeneratorPlatform != *platformName) { - std::string message = cmStrCat( - "Error: generator platform: ", this->GeneratorPlatform, '\n', - "Does not match the platform used previously: ", *platformName, '\n', - "Either remove the CMakeCache.txt file and CMakeFiles " - "directory or choose a different binary directory."); + std::string message = + cmStrCat("Error: generator platform: ", this->GeneratorPlatform, + "\n" + "Does not match the platform used previously: ", + *platformName, + "\n" + "Either remove the CMakeCache.txt file and CMakeFiles " + "directory or choose a different binary directory."); cmSystemTools::Error(message); return -2; } @@ -2576,8 +2585,11 @@ int cmake::ActualConfigure() this->State->GetInitializedCacheValue("CMAKE_GENERATOR_TOOLSET")) { if (this->GeneratorToolsetSet && this->GeneratorToolset != *tsName) { std::string message = - cmStrCat("Error: generator toolset: ", this->GeneratorToolset, '\n', - "Does not match the toolset used previously: ", *tsName, '\n', + cmStrCat("Error: generator toolset: ", this->GeneratorToolset, + "\n" + "Does not match the toolset used previously: ", + *tsName, + "\n" "Either remove the CMakeCache.txt file and CMakeFiles " "directory or choose a different binary directory."); cmSystemTools::Error(message); @@ -2692,9 +2704,9 @@ int cmake::ActualConfigure() if (this->Instrumentation->HasQuery()) { std::string launcher; if (mf->IsOn("CTEST_USE_LAUNCHERS")) { - launcher = - cmStrCat("\"", cmSystemTools::GetCTestCommand(), "\" --launch ", - "--current-build-dir "); + launcher = cmStrCat("\"", cmSystemTools::GetCTestCommand(), + "\" --launch " + "--current-build-dir "); } else { launcher = cmStrCat("\"", cmSystemTools::GetCTestCommand(), "\" --instrument "); @@ -2705,13 +2717,14 @@ int cmake::ActualConfigure() this->State->SetGlobalProperty( "RULE_LAUNCH_COMPILE", cmStrCat( - launcher, "--command-type compile", common_args, "--config ", + launcher, "--command-type compile", common_args, + "--config " "--output --source --language -- ")); this->State->SetGlobalProperty( "RULE_LAUNCH_LINK", cmStrCat( launcher, "--command-type link", common_args, - "--output --target-type --config ", + "--output --target-type --config " "--language --target-labels \"\" -- ")); this->State->SetGlobalProperty( "RULE_LAUNCH_CUSTOM",