|
|
@@ -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
|