From bc135b7fc219187b5154e13f3606b64759f269fc Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 5 May 2006 20:54:53 -0400 Subject: BUG: MSVC* variables should be set in IDE generators instead of just NMake. --- Source/cmGlobalVisualStudio6Generator.cxx | 1 + Source/cmGlobalVisualStudio71Generator.cxx | 5 ++++- Source/cmGlobalVisualStudio71Generator.h | 1 + Source/cmGlobalVisualStudio7Generator.cxx | 7 +++++++ Source/cmGlobalVisualStudio7Generator.h | 1 + Source/cmGlobalVisualStudio8Generator.cxx | 6 ++++++ Source/cmGlobalVisualStudio8Generator.h | 1 + 7 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index d2b5b6f..164727a 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -32,6 +32,7 @@ void cmGlobalVisualStudio6Generator::EnableLanguage(std::vectorcons 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); } diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index d25785b..f37ecf2 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -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, diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index 976758c..dc51fe0 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -44,6 +44,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); protected: + virtual void AddPlatformDefinitions(cmMakefile* mf); virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, std::vector& generators); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index f1bf776..c760a20 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -36,6 +36,8 @@ void cmGlobalVisualStudio7Generator::EnableLanguage(std::vectorcons 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::vectorcons } +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) diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 59588ce..1344c8a 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -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); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 051f718..f92d7bb 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -57,6 +57,12 @@ void cmGlobalVisualStudio8Generator::GetDocumentation(cmDocumentationEntry& entr } //---------------------------------------------------------------------------- +void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf) +{ + mf->AddDefinition("MSVC80", "1"); +} + +//---------------------------------------------------------------------------- void cmGlobalVisualStudio8Generator::Configure() { this->cmGlobalVisualStudio7Generator::Configure(); diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index c4992e0..8fd1937 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -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& generators); virtual void WriteSLNHeader(std::ostream& fout); -- cgit v0.12