diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-07-26 19:40:56 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-07-30 22:33:07 (GMT) |
commit | 1b60137b98b26866c84ca29aee62031d429f34a5 (patch) | |
tree | b1f89ba1b5dc7dcae93df9a100b4fcccb68ef550 | |
parent | e1b70d7286d8a53b5046b1fb5e2b042333f5b736 (diff) | |
download | CMake-1b60137b98b26866c84ca29aee62031d429f34a5.zip CMake-1b60137b98b26866c84ca29aee62031d429f34a5.tar.gz CMake-1b60137b98b26866c84ca29aee62031d429f34a5.tar.bz2 |
strings: combine string literals
-rw-r--r-- | Source/CPack/cmCPackBundleGenerator.cxx | 20 | ||||
-rw-r--r-- | Source/CPack/cmCPackProductBuildGenerator.cxx | 28 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 52 |
3 files changed, 59 insertions, 41 deletions
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index dad404a..37be798 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -86,24 +86,28 @@ int cmCPackBundleGenerator::ConstructBundle() std::string const staging = toplevel; std::ostringstream contents; - contents << staging << "/" << cpack_bundle_name << ".app/" - << "Contents"; + contents << staging << "/" << cpack_bundle_name + << ".app/" + "Contents"; std::ostringstream application; - application << contents.str() << "/" - << "MacOS"; + application << contents.str() + << "/" + "MacOS"; std::ostringstream resources; - resources << contents.str() << "/" - << "Resources"; + resources << contents.str() + << "/" + "Resources"; // Install a required, user-provided bundle metadata file ... std::ostringstream plist_source; plist_source << cpack_bundle_plist; std::ostringstream plist_target; - plist_target << contents.str() << "/" - << "Info.plist"; + plist_target << contents.str() + << "/" + "Info.plist"; if (!this->CopyFile(plist_source, plist_target)) { cmCPackLogger( diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index 843219d..fd3c659 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -102,10 +102,15 @@ int cmCPackProductBuildGenerator::PackageFiles() pkgCmd << productbuild << " --distribution \"" << packageDirFileName << "/Contents/distribution.dist\"" - << " --package-path \"" << packageDirFileName << "/Contents/Packages" + " --package-path \"" + << packageDirFileName + << "/Contents/Packages" + "\"" + " --resources \"" + << resDir << "\"" - << " --resources \"" << resDir << "\"" - << " --version \"" << version << "\"" + " --version \"" + << version << "\"" << (identifier.empty() ? std::string{} : cmStrCat(" --identifier \"", identifier, '"')) @@ -236,11 +241,18 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage( keychainPath = p; } - pkgCmd << pkgbuild << " --root \"" << packageDir << "\"" - << " --identifier \"" << pkgId << "\"" - << " --scripts \"" << scriptDir << "\"" - << " --version \"" << version << "\"" - << " --install-location \"/\"" + pkgCmd << pkgbuild << " --root \"" << packageDir + << "\"" + " --identifier \"" + << pkgId + << "\"" + " --scripts \"" + << scriptDir + << "\"" + " --version \"" + << version + << "\"" + " --install-location \"/\"" << (identityName.empty() ? std::string{} : cmStrCat(" --sign \"", identityName, "\"")) << (keychainPath.empty() diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index b7766dc..5411a23 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -721,12 +721,12 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile( this->CurrentReRunCMakeMakefile += "/ReRunCMake.make"; cmGeneratedFileStream makefileStream(this->CurrentReRunCMakeMakefile); makefileStream.SetCopyIfDifferent(true); - makefileStream << "# Generated by CMake, DO NOT EDIT\n\n"; + makefileStream << "# Generated by CMake, DO NOT EDIT\n\n" - makefileStream << "TARGETS:= \n"; - makefileStream << "empty:= \n"; - makefileStream << "space:= $(empty) $(empty)\n"; - makefileStream << "spaceplus:= $(empty)\\ $(empty)\n\n"; + "TARGETS:= \n" + "empty:= \n" + "space:= $(empty) $(empty)\n" + "spaceplus:= $(empty)\\ $(empty)\n\n"; for (const auto& lfile : lfiles) { makefileStream << "TARGETS += $(subst $(space),$(spaceplus),$(wildcard " @@ -738,12 +738,13 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile( cmStrCat(root->GetBinaryDirectory(), "/CMakeFiles/cmake.check_cache"); if (cm->DoWriteGlobVerifyTarget()) { - makefileStream << ".NOTPARALLEL:\n\n"; - makefileStream << ".PHONY: all VERIFY_GLOBS\n\n"; - makefileStream << "all: VERIFY_GLOBS " - << this->ConvertToRelativeForMake(checkCache) << "\n\n"; - makefileStream << "VERIFY_GLOBS:\n"; - makefileStream << "\t" + makefileStream << ".NOTPARALLEL:\n\n" + ".PHONY: all VERIFY_GLOBS\n\n" + "all: VERIFY_GLOBS " + << this->ConvertToRelativeForMake(checkCache) + << "\n\n" + "VERIFY_GLOBS:\n" + "\t" << this->ConvertToRelativeForMake( cmSystemTools::GetCMakeCommand()) << " -P " @@ -2218,12 +2219,13 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile( return; } makefileStream.SetCopyIfDifferent(true); - makefileStream << "# Generated by CMake, DO NOT EDIT\n"; - makefileStream << "# Custom rules for " << target->GetName() << "\n"; + makefileStream << "# Generated by CMake, DO NOT EDIT\n" + "# Custom rules for " + << target->GetName() << '\n'; // disable the implicit rules makefileStream << ".SUFFIXES: " - << "\n"; + "\n"; // have all depend on all outputs makefileStream << "all: "; @@ -4696,9 +4698,9 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackMakefile( // one more pass for external depend information not handled // correctly by xcode /* clang-format off */ - makefileStream << "# DO NOT EDIT\n"; - makefileStream << "# This makefile makes sure all linkable targets are\n"; - makefileStream << "# up-to-date with anything they link to\n" + makefileStream << "# DO NOT EDIT\n" + "# This makefile makes sure all linkable targets are\n" + "# up-to-date with anything they link to\n" "default:\n" "\techo \"Do not invoke directly\"\n" "\n"; @@ -4776,8 +4778,8 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackMakefile( } // Write the action to remove the target if it is out of date. - makefileStream << "\n"; - makefileStream << "\t/bin/rm -f " + makefileStream << "\n" + "\t/bin/rm -f " << this->ConvertToRelativeForMake(tfull) << "\n"; // if building for more than one architecture // then remove those executables as well @@ -4798,8 +4800,8 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackMakefile( } makefileStream << "\n\n" - << "# For each target create a dummy rule" - << "so the target does not have to exist\n"; + "# For each target create a dummy rule" + "so the target does not have to exist\n"; for (auto const& dummyRule : dummyRules) { makefileStream << dummyRule << ":\n"; } @@ -4942,8 +4944,8 @@ void cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout, { SortXCodeObjects(); - fout << "// !$*UTF8*$!\n"; - fout << "{\n"; + fout << "// !$*UTF8*$!\n" + "{\n"; cmXCodeObject::Indent(1, fout); fout << "archiveVersion = 1;\n"; cmXCodeObject::Indent(1, fout); @@ -4955,8 +4957,8 @@ void cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout, cmXCode21Object::PrintList(this->XCodeObjects, fout); cmXCodeObject::Indent(1, fout); fout << "rootObject = " << this->RootObject->GetId() - << " /* Project object */;\n"; - fout << "}\n"; + << " /* Project object */;\n" + "}\n"; } const char* cmGlobalXCodeGenerator::GetCMakeCFGIntDir() const |