summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/CPack/cmCPackGenerator.cxx2
-rw-r--r--Source/cmSystemTools.cxx2
-rw-r--r--Source/cmXCodeScheme.cxx2
-rw-r--r--Source/cmake.cxx2
-rw-r--r--Source/cmcmd.cxx19
5 files changed, 11 insertions, 16 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index fd8149503c..c641175442 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -829,7 +829,7 @@ int cmCPackGenerator::InstallCMakeProject(
* - Because it was already used for component install
* in order to put things in subdirs...
*/
- cmSystemTools::PutEnv(std::string("DESTDIR=") + tempInstallDirectory);
+ cmSystemTools::PutEnv("DESTDIR=" + tempInstallDirectory);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"- Creating directory: '" << dir << "'" << std::endl);
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 1e78d36938..798c29ad45 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1213,7 +1213,7 @@ bool cmSystemTools::UnsetEnv(const char* value)
{
# if !defined(HAVE_UNSETENV)
std::string var = cmStrCat(value, '=');
- return cmSystemTools::PutEnv(var.c_str());
+ return cmSystemTools::PutEnv(var);
# else
unsetenv(value);
return true;
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index f4c2f2d4c7..0e3cf08d9a 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -33,7 +33,7 @@ void cmXCodeScheme::WriteXCodeSharedScheme(const std::string& xcProjDir,
// Create shared scheme sub-directory tree
//
std::string xcodeSchemeDir = cmStrCat(xcProjDir, "/xcshareddata/xcschemes");
- cmSystemTools::MakeDirectory(xcodeSchemeDir.c_str());
+ cmSystemTools::MakeDirectory(xcodeSchemeDir);
std::string xcodeSchemeFile =
cmStrCat(xcodeSchemeDir, '/', this->TargetName, ".xcscheme");
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 638f10ef62..265684915c 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1371,7 +1371,7 @@ struct SaveCacheEntry
int cmake::HandleDeleteCacheVariables(const std::string& var)
{
- std::vector<std::string> argsSplit = cmExpandedList(std::string(var), true);
+ std::vector<std::string> argsSplit = cmExpandedList(var, true);
// erase the property to avoid infinite recursion
this->State->SetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", "");
if (this->State->GetIsInTryCompile()) {
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 6882fddea8..49e8a4f504 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -600,8 +600,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
}
cmsys::ifstream fin(args[3].c_str(), std::ios::in | std::ios::binary);
if (!fin) {
- std::cerr << "could not open object list file: " << args[3].c_str()
- << "\n";
+ std::cerr << "could not open object list file: " << args[3] << "\n";
return 1;
}
std::vector<std::string> files;
@@ -624,13 +623,12 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
}
FILE* fout = cmsys::SystemTools::Fopen(args[2], "w+");
if (!fout) {
- std::cerr << "could not open output .def file: " << args[2].c_str()
- << "\n";
+ std::cerr << "could not open output .def file: " << args[2] << "\n";
return 1;
}
bindexplib deffile;
if (args.size() >= 5) {
- auto a = args[4];
+ std::string const& a = args[4];
if (cmHasLiteralPrefix(a, "--nm=")) {
deffile.SetNmPath(a.substr(5));
std::cerr << a.substr(5) << "\n";
@@ -638,7 +636,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
std::cerr << "unknown argument: " << a << "\n";
}
}
- for (auto const& file : files) {
+ for (std::string const& file : files) {
std::string const& ext = cmSystemTools::GetFilenameLastExtension(file);
if (cmSystemTools::LowerCase(ext) == ".def") {
if (!deffile.AddDefinitionFile(file.c_str())) {
@@ -1020,7 +1018,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
// Command to create a symbolic link. Fails on platforms not
// supporting them.
if (args[1] == "create_symlink" && args.size() == 4) {
- const char* destinationFileName = args[3].c_str();
+ std::string const& destinationFileName = args[3];
if ((cmSystemTools::FileExists(destinationFileName) ||
cmSystemTools::FileIsSymlink(destinationFileName)) &&
!cmSystemTools::RemoveFile(destinationFileName)) {
@@ -1377,15 +1375,12 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
#if defined(_WIN32) && !defined(__CYGWIN__)
// Write registry value
if (args[1] == "write_regv" && args.size() > 3) {
- return cmSystemTools::WriteRegistryValue(args[2].c_str(),
- args[3].c_str())
- ? 0
- : 1;
+ return cmSystemTools::WriteRegistryValue(args[2], args[3]) ? 0 : 1;
}
// Delete registry value
if (args[1] == "delete_regv" && args.size() > 2) {
- return cmSystemTools::DeleteRegistryValue(args[2].c_str()) ? 0 : 1;
+ return cmSystemTools::DeleteRegistryValue(args[2]) ? 0 : 1;
}
// Remove file