summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio10Generator.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/cmGlobalVisualStudio10Generator.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/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx65
1 files changed, 27 insertions, 38 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 5e29fd7..7be10b1 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -256,49 +256,43 @@ std::string cmGlobalVisualStudio10Generator::GetUserMacrosRegKeyBase()
}
-std::string cmGlobalVisualStudio10Generator
-::GenerateBuildCommand(const char* makeProgram,
- const char *projectName, const char *projectDir,
- const char* additionalOptions, const char *targetName,
- const char* config, bool ignoreErrors, bool fast)
+void cmGlobalVisualStudio10Generator::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)
{
// now build the test
- std::string makeCommand
- = cmSystemTools::ConvertToOutputPath(makeProgram);
- std::string lowerCaseCommand = makeCommand;
+ std::string lowerCaseCommand = makeProgram;
cmSystemTools::LowerCase(lowerCaseCommand);
// If makeProgram is devenv, parent class knows how to generate command:
if (lowerCaseCommand.find("devenv") != std::string::npos ||
lowerCaseCommand.find("VCExpress") != std::string::npos)
{
- return cmGlobalVisualStudio7Generator::GenerateBuildCommand(makeProgram,
- projectName, projectDir, additionalOptions, targetName, config,
- ignoreErrors, fast);
+ cmGlobalVisualStudio7Generator::GenerateBuildCommand(
+ makeCommand, makeProgram, projectName, projectDir,
+ targetName, config, fast, makeOptions);
+ return;
}
// Otherwise, assume MSBuild command line, and construct accordingly.
- // 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(makeCommand.find(' ') != std::string::npos)
- {
- cmSystemTools::GetShortPath(makeCommand.c_str(), makeCommand);
- }
+ makeCommand.push_back(makeProgram);
+
// msbuild.exe CxxOnly.sln /t:Build /p:Configuration=Debug /target:ALL_BUILD
if(!targetName || strlen(targetName) == 0)
{
targetName = "ALL_BUILD";
}
- bool clean = false;
if ( targetName && strcmp(targetName, "clean") == 0 )
{
- clean = true;
- makeCommand += " ";
- makeCommand += projectName;
- makeCommand += ".sln ";
- makeCommand += "/t:Clean ";
+ makeCommand.push_back(std::string(projectName)+".sln");
+ makeCommand.push_back("/t:Clean");
}
else
{
@@ -331,27 +325,22 @@ std::string cmGlobalVisualStudio10Generator
}
}
}
- makeCommand += " ";
- makeCommand += targetProject;
- makeCommand += " ";
+ makeCommand.push_back(targetProject);
}
- makeCommand += "/p:Configuration=";
+ std::string configArg = "/p:Configuration=";
if(config && strlen(config))
{
- makeCommand += config;
+ configArg += config;
}
else
{
- makeCommand += "Debug";
- }
- makeCommand += " /p:VisualStudioVersion=";
- makeCommand += this->GetIDEVersion();
- if ( additionalOptions )
- {
- makeCommand += " ";
- makeCommand += additionalOptions;
+ configArg += "Debug";
}
- return makeCommand;
+ makeCommand.push_back(configArg);
+ makeCommand.push_back(std::string("/p:VisualStudioVersion=")+
+ this->GetIDEVersion());
+ makeCommand.insert(makeCommand.end(),
+ makeOptions.begin(), makeOptions.end());
}
//----------------------------------------------------------------------------