diff options
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r-- | Source/cmcmd.cxx | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 4ac1986..9aee975 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -102,8 +102,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) { if(!cmSystemTools::cmCopyFile(args[2].c_str(), args[3].c_str())) { - std::cerr << "Error copying file \"" << args[2].c_str() - << "\" to \"" << args[3].c_str() << "\".\n"; + std::cerr << "Error copying file \"" << args[2] + << "\" to \"" << args[3] << "\".\n"; return 1; } return 0; @@ -116,7 +116,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) args[3].c_str())) { std::cerr << "Error copying file (if different) from \"" - << args[2].c_str() << "\" to \"" << args[3].c_str() + << args[2] << "\" to \"" << args[3] << "\".\n"; return 1; } @@ -129,7 +129,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) if(!cmSystemTools::CopyADirectory(args[2].c_str(), args[3].c_str())) { std::cerr << "Error copying directory from \"" - << args[2].c_str() << "\" to \"" << args[3].c_str() + << args[2] << "\" to \"" << args[3] << "\".\n"; return 1; } @@ -143,7 +143,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) { std::string e = cmSystemTools::GetLastSystemError(); std::cerr << "Error renaming from \"" - << args[2].c_str() << "\" to \"" << args[3].c_str() + << args[2] << "\" to \"" << args[3] << "\": " << e << "\n"; return 1; } @@ -156,7 +156,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) if(cmSystemTools::FilesDiffer(args[2].c_str(), args[3].c_str())) { std::cerr << "Files \"" - << args[2].c_str() << "\" to \"" << args[3].c_str() + << args[2] << "\" to \"" << args[3] << "\" are different.\n"; return 1; } @@ -199,7 +199,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) std::vector<std::string>::iterator it; for ( it = env.begin(); it != env.end(); ++ it ) { - std::cout << it->c_str() << std::endl; + std::cout << *it << std::endl; } return 0; } @@ -209,7 +209,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) { if(!cmSystemTools::MakeDirectory(args[2].c_str())) { - std::cerr << "Error making directory \"" << args[2].c_str() + std::cerr << "Error making directory \"" << args[2] << "\".\n"; return 1; } @@ -221,7 +221,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) if(cmSystemTools::FileIsDirectory(args[2].c_str()) && !cmSystemTools::RemoveADirectory(args[2].c_str())) { - std::cerr << "Error removing directory \"" << args[2].c_str() + std::cerr << "Error removing directory \"" << args[2] << "\".\n"; return 1; } @@ -613,16 +613,16 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) startDir = cmSystemTools::CollapseFullPath(startDir.c_str()); homeOutDir = cmSystemTools::CollapseFullPath(homeOutDir.c_str()); startOutDir = cmSystemTools::CollapseFullPath(startOutDir.c_str()); - cm.SetHomeDirectory(homeDir.c_str()); - cm.SetStartDirectory(startDir.c_str()); - cm.SetHomeOutputDirectory(homeOutDir.c_str()); - cm.SetStartOutputDirectory(startOutDir.c_str()); - if(cmGlobalGenerator* ggd = cm.CreateGlobalGenerator(gen.c_str())) + cm.SetHomeDirectory(homeDir); + cm.SetStartDirectory(startDir); + cm.SetHomeOutputDirectory(homeOutDir); + cm.SetStartOutputDirectory(startOutDir); + if(cmGlobalGenerator* ggd = cm.CreateGlobalGenerator(gen)) { cm.SetGlobalGenerator(ggd); cmsys::auto_ptr<cmLocalGenerator> lgd(ggd->CreateLocalGenerator()); - lgd->GetMakefile()->SetStartDirectory(startDir.c_str()); - lgd->GetMakefile()->SetStartOutputDirectory(startOutDir.c_str()); + lgd->GetMakefile()->SetStartDirectory(startDir); + lgd->GetMakefile()->SetStartOutputDirectory(startOutDir); lgd->GetMakefile()->MakeStartDirectoriesCurrent(); // Actually scan dependencies. @@ -666,8 +666,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) else if (args[1] == "cmake_autogen" && args.size() >= 4) { cmQtAutoGenerators autogen; - const char *config = args[3].empty() ? 0 : args[3].c_str(); - bool autogenSuccess = autogen.Run(args[2].c_str(), config); + std::string const& config = args[3]; + bool autogenSuccess = autogen.Run(args[2], config); return autogenSuccess ? 0 : 1; } #endif @@ -677,7 +677,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) { std::string flags = args[2]; std::string outFile = args[3]; - std::vector<cmStdString> files; + std::vector<std::string> files; for (std::string::size_type cc = 4; cc < args.size(); cc ++) { files.push_back(args[cc]); @@ -1143,7 +1143,7 @@ int cmcmd::VisualStudioLink(std::vector<std::string>& args, int type) } int cmcmd::ParseVisualStudioLinkCommand(std::vector<std::string>& args, - std::vector<cmStdString>& command, + std::vector<std::string>& command, std::string& targetName) { std::vector<std::string>::iterator i = args.begin(); @@ -1171,17 +1171,17 @@ int cmcmd::ParseVisualStudioLinkCommand(std::vector<std::string>& args, } bool cmcmd::RunCommand(const char* comment, - std::vector<cmStdString>& command, + std::vector<std::string>& command, bool verbose, int* retCodeOut) { if(verbose) { std::cout << comment << ":\n"; - for(std::vector<cmStdString>::iterator i = command.begin(); + for(std::vector<std::string>::iterator i = command.begin(); i != command.end(); ++i) { - std::cout << i->c_str() << " "; + std::cout << *i << " "; } std::cout << "\n"; } @@ -1239,16 +1239,16 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args, // 7. Finally, the Linker does another incremental link, but since the // only thing that has changed is the *.res file that contains the // manifest it is a short link. - std::vector<cmStdString> linkCommand; + std::vector<std::string> linkCommand; std::string targetName; if(cmcmd::ParseVisualStudioLinkCommand(args, linkCommand, targetName) == -1) { return -1; } std::string manifestArg = "/MANIFESTFILE:"; - std::vector<cmStdString> rcCommand; + std::vector<std::string> rcCommand; rcCommand.push_back(cmSystemTools::FindProgram("rc.exe")); - std::vector<cmStdString> mtCommand; + std::vector<std::string> mtCommand; mtCommand.push_back(cmSystemTools::FindProgram("mt.exe")); std::string tempManifest; tempManifest = targetName; @@ -1257,7 +1257,7 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args, resourceInputFile += ".resource.txt"; if(verbose) { - std::cout << "Create " << resourceInputFile.c_str() << "\n"; + std::cout << "Create " << resourceInputFile << "\n"; } // Create input file for rc command cmsys::ofstream fout(resourceInputFile.c_str()); @@ -1269,7 +1269,7 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args, manifestFile += ".embed.manifest"; std::string fullPath= cmSystemTools::CollapseFullPath(manifestFile.c_str()); fout << type << " /* CREATEPROCESS_MANIFEST_RESOURCE_ID " - "*/ 24 /* RT_MANIFEST */ " << "\"" << fullPath.c_str() << "\""; + "*/ 24 /* RT_MANIFEST */ " << "\"" << fullPath << "\""; fout.close(); manifestArg += tempManifest; // add the manifest arg to the linkCommand @@ -1281,7 +1281,7 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args, { if(verbose) { - std::cout << "Create empty: " << manifestFile.c_str() << "\n"; + std::cout << "Create empty: " << manifestFile << "\n"; } cmsys::ofstream foutTmp(manifestFile.c_str()); } @@ -1349,7 +1349,7 @@ int cmcmd::VisualStudioLinkNonIncremental(std::vector<std::string>& args, bool hasManifest, bool verbose) { - std::vector<cmStdString> linkCommand; + std::vector<std::string> linkCommand; std::string targetName; if(cmcmd::ParseVisualStudioLinkCommand(args, linkCommand, targetName) == -1) { @@ -1368,7 +1368,7 @@ int cmcmd::VisualStudioLinkNonIncremental(std::vector<std::string>& args, { return 0; } - std::vector<cmStdString> mtCommand; + std::vector<std::string> mtCommand; mtCommand.push_back(cmSystemTools::FindProgram("mt.exe")); mtCommand.push_back("/nologo"); mtCommand.push_back("/manifest"); |