some try compile fixes

This commit is contained in:
Ken Martin 2002-09-22 09:53:26 -04:00
parent f7ec3c2a76
commit c9d16defb0
2 changed files with 26 additions and 10 deletions

View File

@ -43,7 +43,8 @@ void cmGlobalVisualStudio7Generator::EnableLanguage(const char*,
int cmGlobalVisualStudio7Generator::TryCompile(const char *,
const char *bindir,
const char *projectName,
const char *targetName)
const char *targetName,
std::string *output)
{
// now build the test
std::string makeCommand =
@ -61,8 +62,6 @@ int cmGlobalVisualStudio7Generator::TryCompile(const char *,
/**
* Run an executable command and put the stdout in output.
*/
std::string output;
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(bindir);
@ -77,7 +76,7 @@ int cmGlobalVisualStudio7Generator::TryCompile(const char *,
#endif
makeCommand += " ";
makeCommand += projectName;
makeCommand += ".sln /rebuild Debug /project ";
makeCommand += ".sln /build Debug /project ";
if (targetName)
{
makeCommand += targetName;
@ -88,7 +87,8 @@ int cmGlobalVisualStudio7Generator::TryCompile(const char *,
}
int retVal;
if (!cmSystemTools::RunCommand(makeCommand.c_str(), output, retVal))
if (!cmSystemTools::RunCommand(makeCommand.c_str(), *output, retVal,
0, false))
{
cmSystemTools::Error("Generator: execution of devenv failed.");
// return to the original directory
@ -571,3 +571,14 @@ std::string cmGlobalVisualStudio7Generator::CreateGUID(const char* name)
return ret;
}
void cmGlobalVisualStudio7Generator::LocalGenerate()
{
// load the possible configuraitons
this->GenerateConfigurations();
this->cmGlobalGenerator::LocalGenerate();
}
std::vector<std::string> *cmGlobalVisualStudio7Generator::GetConfigurations()
{
return &m_Configurations;
};

View File

@ -48,7 +48,8 @@ public:
* loaded commands, not as part of the usual build process.
*/
virtual int TryCompile(const char *srcdir, const char *bindir,
const char *projectName, const char *targetName);
const char *projectName, const char *targetName,
std::string *output);
/**
* Generate the all required files for building this project/tree. This
@ -57,6 +58,13 @@ public:
*/
virtual void Generate();
/**
* Generate the required files for building this directory. This
* basically creates a single LocalGenerators and
* requests that it Generate.
*/
virtual void LocalGenerate();
/**
* Generate the DSW workspace file.
*/
@ -65,10 +73,7 @@ public:
/**
* Get the list of configurations
*/
std::vector<std::string> *GetConfigurations()
{
return &m_Configurations;
};
std::vector<std::string> *GetConfigurations();
private:
void SetupTests();