diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 28 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio11Generator.cxx | 50 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio11Generator.h | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio12Generator.cxx | 50 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio12Generator.h | 4 |
6 files changed, 139 insertions, 1 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 5189569..c708a08 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -148,20 +148,46 @@ bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s, } //---------------------------------------------------------------------------- -bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile*) +bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf) { if(this->SystemName == "WindowsPhone") { this->SystemIsWindowsPhone = true; + if(!this->InitializeWindowsPhone(mf)) + { + return false; + } } else if(this->SystemName == "WindowsStore") { this->SystemIsWindowsStore = true; + if(!this->InitializeWindowsStore(mf)) + { + return false; + } } return true; } //---------------------------------------------------------------------------- +bool cmGlobalVisualStudio10Generator::InitializeWindowsPhone(cmMakefile* mf) +{ + cmOStringStream e; + e << this->GetName() << " does not support Windows Phone."; + mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + return false; +} + +//---------------------------------------------------------------------------- +bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf) +{ + cmOStringStream e; + e << this->GetName() << " does not support Windows Store."; + mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + return false; +} + +//---------------------------------------------------------------------------- void cmGlobalVisualStudio10Generator ::AddVSPlatformToolsetDefinition(cmMakefile* mf) const { diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index e3156bf..6245b28 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -107,6 +107,10 @@ public: protected: virtual void Generate(); virtual bool InitializeSystem(cmMakefile* mf); + virtual bool InitializeWindowsPhone(cmMakefile* mf); + virtual bool InitializeWindowsStore(cmMakefile* mf); + virtual std::string SelectWindowsPhoneToolset() const { return ""; } + virtual std::string SelectWindowsStoreToolset() const { return ""; } virtual const char* GetIDEVersion() { return "10.0"; } diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index e5a159b..33cfaa1 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -129,6 +129,56 @@ cmGlobalVisualStudio11Generator::MatchesGeneratorName( } //---------------------------------------------------------------------------- +bool cmGlobalVisualStudio11Generator::InitializeWindowsPhone(cmMakefile* mf) +{ + this->DefaultPlatformToolset = this->SelectWindowsPhoneToolset(); + if(this->DefaultPlatformToolset.empty()) + { + cmOStringStream e; + e << this->GetName() << " supports Windows Phone '8.0', but not '" + << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + return false; + } + return true; +} + +//---------------------------------------------------------------------------- +bool cmGlobalVisualStudio11Generator::InitializeWindowsStore(cmMakefile* mf) +{ + this->DefaultPlatformToolset = this->SelectWindowsStoreToolset(); + if(this->DefaultPlatformToolset.empty()) + { + cmOStringStream e; + e << this->GetName() << " supports Windows Store '8.0', but not '" + << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + return false; + } + return true; +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset() const +{ + if(this->SystemVersion == "8.0") + { + return "v110_wp80"; + } + return this->cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset(); +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset() const +{ + if(this->SystemVersion == "8.0") + { + return "v110"; + } + return this->cmGlobalVisualStudio10Generator::SelectWindowsStoreToolset(); +} + +//---------------------------------------------------------------------------- void cmGlobalVisualStudio11Generator::WriteSLNHeader(std::ostream& fout) { fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n"; diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index 3d89a94..0b497db 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -34,6 +34,10 @@ public: /** TODO: VS 11 user macro support. */ virtual std::string GetUserMacrosDirectory() { return ""; } protected: + virtual bool InitializeWindowsPhone(cmMakefile* mf); + virtual bool InitializeWindowsStore(cmMakefile* mf); + virtual std::string SelectWindowsPhoneToolset() const; + virtual std::string SelectWindowsStoreToolset() const; virtual const char* GetIDEVersion() { return "11.0"; } bool UseFolderProperty(); static std::set<std::string> GetInstalledWindowsCESDKs(); diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index 4235cbc..29ecfe0 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -109,6 +109,56 @@ cmGlobalVisualStudio12Generator::MatchesGeneratorName( } //---------------------------------------------------------------------------- +bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf) +{ + this->DefaultPlatformToolset = this->SelectWindowsPhoneToolset(); + if(this->DefaultPlatformToolset.empty()) + { + cmOStringStream e; + e << this->GetName() << " supports Windows Phone '8.0' and '8.1', " + "but not '" << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + return false; + } + return true; +} + +//---------------------------------------------------------------------------- +bool cmGlobalVisualStudio12Generator::InitializeWindowsStore(cmMakefile* mf) +{ + this->DefaultPlatformToolset = this->SelectWindowsStoreToolset(); + if(this->DefaultPlatformToolset.empty()) + { + cmOStringStream e; + e << this->GetName() << " supports Windows Store '8.0' and '8.1', " + "but not '" << this->SystemVersion << "'. Check CMAKE_SYSTEM_VERSION."; + mf->IssueMessage(cmake::FATAL_ERROR, e.str()); + return false; + } + return true; +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio12Generator::SelectWindowsPhoneToolset() const +{ + if(this->SystemVersion == "8.1") + { + return "v120_wp81"; + } + return this->cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset(); +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio12Generator::SelectWindowsStoreToolset() const +{ + if(this->SystemVersion == "8.1") + { + return "v120"; + } + return this->cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset(); +} + +//---------------------------------------------------------------------------- void cmGlobalVisualStudio12Generator::WriteSLNHeader(std::ostream& fout) { fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n"; diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h index 8ac2d1d..ec85f10 100644 --- a/Source/cmGlobalVisualStudio12Generator.h +++ b/Source/cmGlobalVisualStudio12Generator.h @@ -39,6 +39,10 @@ public: //version number virtual const char* GetToolsVersion() { return "12.0"; } protected: + virtual bool InitializeWindowsPhone(cmMakefile* mf); + virtual bool InitializeWindowsStore(cmMakefile* mf); + virtual std::string SelectWindowsPhoneToolset() const; + virtual std::string SelectWindowsStoreToolset() const; virtual const char* GetIDEVersion() { return "12.0"; } private: class Factory; |