summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-15 18:33:32 (GMT)
committerBrad King <brad.king@kitware.com>2013-11-18 13:26:21 (GMT)
commit8904d1410be3d62fc48d3bdaa87cbce3895fc815 (patch)
tree066ea5f6e8910566cc471c852b9782bf7f86e437 /Source/cmGlobalVisualStudio7Generator.cxx
parent0814d0a6559ed3634dafb372f34491407a27c5e8 (diff)
downloadCMake-8904d1410be3d62fc48d3bdaa87cbce3895fc815.zip
CMake-8904d1410be3d62fc48d3bdaa87cbce3895fc815.tar.gz
CMake-8904d1410be3d62fc48d3bdaa87cbce3895fc815.tar.bz2
cmGlobalGenerator: Cleanup GenerateBuildCommand API
All cmGlobalGenerator::GenerateBuildCommand call sites that need to produce a string now generate "cmake --build" commands. The remaining call sites immediately pass the result to cmSystemTools::RunSingleCommand. Avoid the intermediate string and argument parsing by directly producing a vector of strings. Also drop the ignoreErrors argument because no call sites remain that use it.
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx64
1 files changed, 22 insertions, 42 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index d476c24..04563f3 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -110,35 +110,19 @@ void cmGlobalVisualStudio7Generator
}
-std::string cmGlobalVisualStudio7Generator
-::GenerateBuildCommand(const char* makeProgram,
- const char *projectName, const char *projectDir,
- const char* additionalOptions, const char *targetName,
- const char* config, bool ignoreErrors, bool)
-{
- // Visual studio 7 doesn't need project dir
- (void) projectDir;
- // Ingoring errors is not implemented in visual studio 6
- (void) ignoreErrors;
-
- // now build the test
- std::string makeCommand =
- cmSystemTools::ConvertToOutputPath(makeProgram);
- std::string lowerCaseCommand = makeCommand;
- cmSystemTools::LowerCase(lowerCaseCommand);
-
- // if there are spaces in the makeCommand, assume a full path
- // and convert it to a path with no spaces in it as the
- // RunSingleCommand does not like spaces
-#if defined(_WIN32) && !defined(__CYGWIN__)
- if(makeCommand.find(' ') != std::string::npos)
- {
- cmSystemTools::GetShortPath(makeCommand.c_str(), makeCommand);
- }
-#endif
- makeCommand += " ";
- makeCommand += projectName;
- makeCommand += ".sln ";
+void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
+ std::vector<std::string>& makeCommand,
+ const char* makeProgram,
+ const char* projectName,
+ const char* /*projectDir*/,
+ const char* targetName,
+ const char* config,
+ bool /*fast*/,
+ std::vector<std::string> const& makeOptions)
+{
+ makeCommand.push_back(makeProgram);
+
+ makeCommand.push_back(std::string(projectName) + ".sln");
bool clean = false;
if ( targetName && strcmp(targetName, "clean") == 0 )
{
@@ -147,37 +131,33 @@ std::string cmGlobalVisualStudio7Generator
}
if(clean)
{
- makeCommand += "/clean ";
+ makeCommand.push_back("/clean");
}
else
{
- makeCommand += "/build ";
+ makeCommand.push_back("/build");
}
if(config && strlen(config))
{
- makeCommand += config;
+ makeCommand.push_back(config);
}
else
{
- makeCommand += "Debug";
+ makeCommand.push_back("Debug");
}
- makeCommand += " /project ";
+ makeCommand.push_back("/project");
if (targetName && strlen(targetName))
{
- makeCommand += targetName;
+ makeCommand.push_back(targetName);
}
else
{
- makeCommand += "ALL_BUILD";
+ makeCommand.push_back("ALL_BUILD");
}
- if ( additionalOptions )
- {
- makeCommand += " ";
- makeCommand += additionalOptions;
- }
- return makeCommand;
+ makeCommand.insert(makeCommand.end(),
+ makeOptions.begin(), makeOptions.end());
}
///! Create a local generator appropriate to this Global Generator