summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-04-28 22:18:54 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-04-28 22:18:54 (GMT)
commitcb3ea2328a72a82b6e6174bdc9055459a207c26f (patch)
tree6b9395a6ed2bd555d47499f92317b50a445717e1 /Source/cmGlobalVisualStudio7Generator.cxx
parent7c5745ae9560851baf383cdac731ccf4c5a65014 (diff)
downloadCMake-cb3ea2328a72a82b6e6174bdc9055459a207c26f.zip
CMake-cb3ea2328a72a82b6e6174bdc9055459a207c26f.tar.gz
CMake-cb3ea2328a72a82b6e6174bdc9055459a207c26f.tar.bz2
ENH: Start working on a method that abstracts generating of build command
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx41
1 files changed, 10 insertions, 31 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 5dbc678..9b3952e 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -43,28 +43,14 @@ void cmGlobalVisualStudio7Generator::EnableLanguage(std::vector<std::string>cons
this->cmGlobalGenerator::EnableLanguage(lang, mf);
}
-int cmGlobalVisualStudio7Generator::Build(
- const char *,
- const char *bindir,
- const char *projectName,
- const char *targetName,
- std::string *output,
- const char *makeCommandCSTR,
- const char *config,
- bool clean)
+std::string cmGlobalVisualStudio7Generator::GenerateBuildCommand(const char* makeProgram, const char *projectName, const char *targetName, const char* config)
{
// now build the test
std::string makeCommand =
- cmSystemTools::ConvertToOutputPath(makeCommandCSTR);
+ cmSystemTools::ConvertToOutputPath(makeProgram);
std::string lowerCaseCommand = makeCommand;
cmSystemTools::LowerCase(lowerCaseCommand);
- /**
- * Run an executable command and put the stdout in output.
- */
- std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
- cmSystemTools::ChangeDirectory(bindir);
-
// 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
@@ -77,9 +63,15 @@ int cmGlobalVisualStudio7Generator::Build(
makeCommand += " ";
makeCommand += projectName;
makeCommand += ".sln ";
+ bool clean = false;
+ if ( targetName && strcmp(targetName, "clean") == 0 )
+ {
+ clean = true;
+ targetName = "ALL_BUILD";
+ }
if(clean)
{
- makeCommand += "/rebuild ";
+ makeCommand += "/clean";
}
else
{
@@ -104,20 +96,7 @@ int cmGlobalVisualStudio7Generator::Build(
{
makeCommand += "ALL_BUILD";
}
-
- int retVal;
- int timeout = cmGlobalGenerator::s_TryCompileTimeout;
- if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output, &retVal,
- 0, false, timeout))
- {
- cmSystemTools::Error("Generator: execution of devenv failed.");
- // return to the original directory
- cmSystemTools::ChangeDirectory(cwd.c_str());
- return 1;
- }
- *output += makeCommand;
- cmSystemTools::ChangeDirectory(cwd.c_str());
- return retVal;
+ return makeCommand;
}
///! Create a local generator appropriate to this Global Generator