summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioGenerator.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-07-27 18:33:36 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-07-28 00:00:59 (GMT)
commit7137b1783549fb33fcc09eabdd0d77511d36c23b (patch)
tree2253f23d4869879ae5dbcee47c0ac8025b7a8aaa /Source/cmGlobalVisualStudioGenerator.cxx
parent2409f62d18b714f3342db99201eadc13420708da (diff)
downloadCMake-7137b1783549fb33fcc09eabdd0d77511d36c23b.zip
CMake-7137b1783549fb33fcc09eabdd0d77511d36c23b.tar.gz
CMake-7137b1783549fb33fcc09eabdd0d77511d36c23b.tar.bz2
cmStrCat: use in Windows-specific sources
Diffstat (limited to 'Source/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx29
1 files changed, 15 insertions, 14 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index ad93b6c..be5b79f 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -185,8 +185,8 @@ std::string cmGlobalVisualStudioGenerator::GetRegistryBase()
std::string cmGlobalVisualStudioGenerator::GetRegistryBase(const char* version)
{
- std::string key = R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\)";
- return key + version;
+ return cmStrCat(R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\)",
+ version);
}
void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
@@ -275,7 +275,7 @@ void cmGlobalVisualStudioGenerator::ConfigureCMakeVisualStudioMacros()
std::string src = cmStrCat(cmSystemTools::GetCMakeRoot(),
"/Templates/" CMAKE_VSMACROS_FILENAME);
- std::string dst = dir + "/CMakeMacros/" CMAKE_VSMACROS_FILENAME;
+ std::string dst = cmStrCat(dir, "/CMakeMacros/" CMAKE_VSMACROS_FILENAME);
// Copy the macros file to the user directory only if the
// destination does not exist or the source location is newer.
@@ -310,7 +310,8 @@ void cmGlobalVisualStudioGenerator::CallVisualStudioMacro(
// - there were .sln/.vcproj files changed during generation
//
if (!dir.empty()) {
- std::string macrosFile = dir + "/CMakeMacros/" CMAKE_VSMACROS_FILENAME;
+ std::string macrosFile =
+ cmStrCat(dir, "/CMakeMacros/" CMAKE_VSMACROS_FILENAME);
std::string nextSubkeyName;
if (cmSystemTools::FileExists(macrosFile) &&
IsVisualStudioMacrosFileRegistered(
@@ -519,9 +520,9 @@ std::string cmGlobalVisualStudioGenerator::GetStartupProjectName(
}
root->GetMakefile()->IssueMessage(
MessageType::AUTHOR_WARNING,
- "Directory property VS_STARTUP_PROJECT specifies target "
- "'" +
- startup + "' that does not exist. Ignoring.");
+ cmStrCat("Directory property VS_STARTUP_PROJECT specifies target "
+ "'",
+ startup, "' that does not exist. Ignoring."));
}
// default, if not specified
@@ -547,7 +548,7 @@ bool IsVisualStudioMacrosFileRegistered(const std::string& macrosFile,
LONG result = ERROR_SUCCESS;
DWORD index = 0;
- keyname = regKeyBase + "\\OtherProjects7";
+ keyname = cmStrCat(regKeyBase, "\\OtherProjects7");
hkey = nullptr;
result =
RegOpenKeyExW(HKEY_CURRENT_USER, cmsys::Encoding::ToWide(keyname).c_str(),
@@ -639,7 +640,7 @@ bool IsVisualStudioMacrosFileRegistered(const std::string& macrosFile,
// as the name of the next subkey.
nextAvailableSubKeyName = std::to_string(index);
- keyname = regKeyBase + "\\RecordingProject7";
+ keyname = cmStrCat(regKeyBase, "\\RecordingProject7");
hkey = nullptr;
result =
RegOpenKeyExW(HKEY_CURRENT_USER, cmsys::Encoding::ToWide(keyname).c_str(),
@@ -685,7 +686,7 @@ void WriteVSMacrosFileRegistryEntry(const std::string& nextAvailableSubKeyName,
const std::string& macrosFile,
const std::string& regKeyBase)
{
- std::string keyname = regKeyBase + "\\OtherProjects7";
+ std::string keyname = cmStrCat(regKeyBase, "\\OtherProjects7");
HKEY hkey = nullptr;
LONG result =
RegOpenKeyExW(HKEY_CURRENT_USER, cmsys::Encoding::ToWide(keyname).c_str(),
@@ -906,10 +907,10 @@ void cmGlobalVisualStudioGenerator::AddSymbolExportCommand(
cmSystemTools::ReplaceString(obj_dir_expanded, this->GetCMakeCFGIntDir(),
configName.c_str());
cmSystemTools::MakeDirectory(obj_dir_expanded);
- std::string const objs_file = obj_dir_expanded + "/objects.txt";
+ std::string const objs_file = cmStrCat(obj_dir_expanded, "/objects.txt");
cmGeneratedFileStream fout(objs_file.c_str());
if (!fout) {
- cmSystemTools::Error("could not open " + objs_file);
+ cmSystemTools::Error(cmStrCat("could not open ", objs_file));
return;
}
@@ -920,7 +921,7 @@ void cmGlobalVisualStudioGenerator::AddSymbolExportCommand(
// It must exist because we populated the mapping just above.
const auto& v = mapping[it];
assert(!v.empty());
- std::string objFile = obj_dir + v;
+ std::string objFile = cmStrCat(obj_dir, v);
objs.push_back(objFile);
}
std::vector<cmSourceFile const*> externalObjectSources;
@@ -976,7 +977,7 @@ bool cmGlobalVisualStudioGenerator::Open(const std::string& bindir,
const std::string& projectName,
bool dryRun)
{
- std::string sln = bindir + "/" + projectName + ".sln";
+ std::string sln = cmStrCat(bindir, "/", projectName, ".sln");
if (dryRun) {
return cmSystemTools::FileExists(sln, true);