summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio6Generator.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/cmGlobalVisualStudio6Generator.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/cmGlobalVisualStudio6Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio6Generator.cxx49
1 files changed, 13 insertions, 36 deletions
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index 917581c..f89a49c 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -67,23 +67,16 @@ void cmGlobalVisualStudio6Generator::GenerateConfigurations(cmMakefile* mf)
}
}
-int cmGlobalVisualStudio6Generator::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 cmGlobalVisualStudio6Generator::GenerateBuildCommand(const char* makeProgram, const char *projectName, const char *targetName,
+ const char* config)
{
// now build the test
std::vector<std::string> mp;
mp.push_back("[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\6.0\\Setup;VsCommonDir]/MSDev98/Bin");
cmSystemTools::ExpandRegistryValues(mp[0]);
- std::string originalCommand = makeCommandCSTR;
+ std::string originalCommand = makeProgram;
std::string makeCommand =
- cmSystemTools::FindProgram(makeCommandCSTR, mp);
+ cmSystemTools::FindProgram(makeProgram, mp);
if(makeCommand.size() == 0)
{
std::string e = "Generator cannot find Visual Studio 6 msdev program \"";
@@ -91,15 +84,10 @@ int cmGlobalVisualStudio6Generator::Build(
e += "\" specified by CMAKE_MAKE_PROGRAM cache entry. ";
e += "Please fix the setting.";
cmSystemTools::Error(e.c_str());
- return 1;
+ return "";
}
makeCommand = cmSystemTools::ConvertToOutputPath(makeCommand.c_str());
- /**
- * 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
@@ -112,6 +100,12 @@ int cmGlobalVisualStudio6Generator::Build(
makeCommand += " ";
makeCommand += projectName;
makeCommand += ".dsw /MAKE \"";
+ bool clean = false;
+ if ( targetName && strcmp(targetName, "clean") == 0 )
+ {
+ clean = true;
+ targetName = "ALL_BUILD";
+ }
if (targetName && strlen(targetName))
{
makeCommand += targetName;
@@ -131,30 +125,13 @@ int cmGlobalVisualStudio6Generator::Build(
}
if(clean)
{
- makeCommand += "\" /REBUILD";
+ makeCommand += "\" /CLEAN";
}
else
{
makeCommand += "\" /BUILD";
}
- int retVal;
- int timeout = cmGlobalGenerator::s_TryCompileTimeout;
- if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output,
- &retVal, 0, false, timeout))
- {
- std::string e = "Error executing make program \"";
- e += originalCommand;
- e += "\" specified by CMAKE_MAKE_PROGRAM cache entry. ";
- e += "The command string used was \"";
- e += makeCommand.c_str();
- e += "\".";
- cmSystemTools::Error(e.c_str());
- // return to the original directory
- cmSystemTools::ChangeDirectory(cwd.c_str());
- return 1;
- }
- cmSystemTools::ChangeDirectory(cwd.c_str());
- return retVal;
+ return makeCommand;
}
///! Create a local generator appropriate to this Global Generator