BUG: MSVC* variables should be set in IDE generators instead of just NMake.

This commit is contained in:
Brad King 2006-05-05 20:54:53 -04:00
parent fad3e1dd77
commit bc135b7fc2
7 changed files with 21 additions and 1 deletions

View File

@ -32,6 +32,7 @@ void cmGlobalVisualStudio6Generator::EnableLanguage(std::vector<std::string>cons
mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
mf->AddDefinition("CMAKE_GENERATOR_Fortran", "ifort");
mf->AddDefinition("MSVC60", "1");
this->GenerateConfigurations(mf);
this->cmGlobalGenerator::EnableLanguage(lang, mf);
}

View File

@ -39,7 +39,10 @@ cmLocalGenerator *cmGlobalVisualStudio71Generator::CreateLocalGenerator()
return lg;
}
void cmGlobalVisualStudio71Generator::AddPlatformDefinitions(cmMakefile* mf)
{
mf->AddDefinition("MSVC71", "1");
}
// Write a SLN file to the stream
void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout,

View File

@ -44,6 +44,7 @@ public:
virtual cmLocalGenerator *CreateLocalGenerator();
protected:
virtual void AddPlatformDefinitions(cmMakefile* mf);
virtual void WriteSLNFile(std::ostream& fout,
cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);

View File

@ -36,6 +36,8 @@ void cmGlobalVisualStudio7Generator::EnableLanguage(std::vector<std::string>cons
mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
mf->AddDefinition("CMAKE_GENERATOR_Fortran", "ifort");
this->AddPlatformDefinitions(mf);
// Create list of configurations requested by user's cache, if any.
this->cmGlobalGenerator::EnableLanguage(lang, mf);
@ -58,6 +60,11 @@ void cmGlobalVisualStudio7Generator::EnableLanguage(std::vector<std::string>cons
}
void cmGlobalVisualStudio7Generator::AddPlatformDefinitions(cmMakefile* mf)
{
mf->AddDefinition("MSVC70", "1");
}
std::string cmGlobalVisualStudio7Generator::GenerateBuildCommand(const char* makeProgram,
const char *projectName, const char* additionalOptions, const char *targetName,
const char* config, bool ignoreErrors)

View File

@ -107,6 +107,7 @@ protected:
bool in_all);
virtual void WriteSLNFooter(std::ostream& fout);
virtual void WriteSLNHeader(std::ostream& fout);
virtual void AddPlatformDefinitions(cmMakefile* mf);
void GenerateConfigurations(cmMakefile* mf);

View File

@ -56,6 +56,12 @@ void cmGlobalVisualStudio8Generator::GetDocumentation(cmDocumentationEntry& entr
entry.full = "";
}
//----------------------------------------------------------------------------
void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf)
{
mf->AddDefinition("MSVC80", "1");
}
//----------------------------------------------------------------------------
void cmGlobalVisualStudio8Generator::Configure()
{

View File

@ -49,6 +49,7 @@ public:
virtual void Configure();
virtual void Generate();
protected:
virtual void AddPlatformDefinitions(cmMakefile* mf);
virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
virtual void WriteSLNHeader(std::ostream& fout);