diff options
author | Brad King <brad.king@kitware.com> | 2014-09-05 18:53:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-09-05 19:03:56 (GMT) |
commit | b97736a23d5d83eb65b6ee0b0429ada9fb331c12 (patch) | |
tree | 5aaf927d1c3e6fe42c60a6321ab5cf573d568a08 /Source | |
parent | 0f1f1271e6ddcea9074afe79685a731d4295c1f5 (diff) | |
download | CMake-b97736a23d5d83eb65b6ee0b0429ada9fb331c12.zip CMake-b97736a23d5d83eb65b6ee0b0429ada9fb331c12.tar.gz CMake-b97736a23d5d83eb65b6ee0b0429ada9fb331c12.tar.bz2 |
VS: Implement CMAKE_GENERATOR_PLATFORM for VS >= 8
For VS generator names that do not specify the platform name, read
CMAKE_GENERATOR_PLATFORM to get it.
Extend the RunCMake.GeneratorPlatform test with a case covering
use of the x64 platform when the test generator is a Visual Studio
generator whose name does not specify a platform.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 14 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 17 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 15 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.h | 2 |
6 files changed, 48 insertions, 4 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index e753c3c..e2d4645 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -125,6 +125,18 @@ bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s, { return false; } + return this->cmGlobalVisualStudio8Generator::SetSystemName(s, mf); +} + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudio10Generator::SetGeneratorPlatform(std::string const& p, + cmMakefile* mf) +{ + if(!this->cmGlobalVisualStudio8Generator::SetGeneratorPlatform(p, mf)) + { + return false; + } if(this->GetPlatformName() == "Itanium" || this->GetPlatformName() == "x64") { if(this->IsExpressEdition() && !this->Find64BitTools(mf)) @@ -132,7 +144,7 @@ bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s, return false; } } - return this->cmGlobalVisualStudio8Generator::SetSystemName(s, mf); + return true; } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 1155508..f1ff9a4 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -31,6 +31,7 @@ public: virtual bool MatchesGeneratorName(const std::string& name) const; virtual bool SetSystemName(std::string const& s, cmMakefile* mf); + virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf); virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf); virtual void GenerateBuildCommand( diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index cb82e54..401e475 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -262,6 +262,10 @@ cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator() //---------------------------------------------------------------------------- std::string const& cmGlobalVisualStudio7Generator::GetPlatformName() const { + if(!this->GeneratorPlatform.empty()) + { + return this->GeneratorPlatform; + } return this->DefaultPlatformName; } @@ -269,6 +273,15 @@ std::string const& cmGlobalVisualStudio7Generator::GetPlatformName() const bool cmGlobalVisualStudio7Generator::SetSystemName(std::string const& s, cmMakefile* mf) { + mf->AddDefinition("CMAKE_VS_INTEL_Fortran_PROJECT_VERSION", + this->GetIntelProjectVersion()); + return this->cmGlobalVisualStudioGenerator::SetSystemName(s, mf); +} + +//---------------------------------------------------------------------------- +bool cmGlobalVisualStudio7Generator::SetGeneratorPlatform(std::string const& p, + cmMakefile* mf) +{ if(this->GetPlatformName() == "x64") { mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE"); @@ -278,9 +291,7 @@ bool cmGlobalVisualStudio7Generator::SetSystemName(std::string const& s, mf->AddDefinition("CMAKE_FORCE_IA64", "TRUE"); } mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName().c_str()); - mf->AddDefinition("CMAKE_VS_INTEL_Fortran_PROJECT_VERSION", - this->GetIntelProjectVersion()); - return this->cmGlobalVisualStudioGenerator::SetSystemName(s, mf); + return this->cmGlobalVisualStudioGenerator::SetGeneratorPlatform(p, mf); } void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf) diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index dc8b915..04a74db 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -46,6 +46,8 @@ public: virtual bool SetSystemName(std::string const& s, cmMakefile* mf); + virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf); + /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); @@ -175,6 +177,7 @@ protected: // Set during OutputSLNFile with the name of the current project. // There is one SLN file per project. std::string CurrentProject; + std::string GeneratorPlatform; std::string DefaultPlatformName; bool MasmEnabled; diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index c91730f..745515b 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -159,6 +159,21 @@ void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf) } //---------------------------------------------------------------------------- +bool cmGlobalVisualStudio8Generator::SetGeneratorPlatform(std::string const& p, + cmMakefile* mf) +{ + if(this->DefaultPlatformName == "Win32") + { + this->GeneratorPlatform = p; + return this->cmGlobalVisualStudio7Generator::SetGeneratorPlatform("", mf); + } + else + { + return this->cmGlobalVisualStudio7Generator::SetGeneratorPlatform(p, mf); + } +} + +//---------------------------------------------------------------------------- // ouput standard header for dsw file void cmGlobalVisualStudio8Generator::WriteSLNHeader(std::ostream& fout) { diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index cb6d3d9..4b41ed7 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -40,6 +40,8 @@ public: cmMakefile *, bool optional); virtual void AddPlatformDefinitions(cmMakefile* mf); + virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf); + /** * Override Configure and Generate to add the build-system check * target. |