diff options
author | Brad King <brad.king@kitware.com> | 2014-07-28 20:15:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-31 18:08:46 (GMT) |
commit | d7938bff37bfa05f34b9ad5a46ae3aff54955eea (patch) | |
tree | 51259231e7382d59da58a9598d19ae705c1fc388 /Source/cmGlobalVisualStudio11Generator.cxx | |
parent | 3abd150ce9df03e24a903dedc952339b58ba79cb (diff) | |
download | CMake-d7938bff37bfa05f34b9ad5a46ae3aff54955eea.zip CMake-d7938bff37bfa05f34b9ad5a46ae3aff54955eea.tar.gz CMake-d7938bff37bfa05f34b9ad5a46ae3aff54955eea.tar.bz2 |
VS: Select WindowsPhone and WindowsStore default toolsets
Teach the VS >= 10 generators to recognize these system names and select
the appropriate default toolset for the system version. Report an error
when the version is not known to be supported by VS.
Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
Diffstat (limited to 'Source/cmGlobalVisualStudio11Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio11Generator.cxx | 50 |
1 files changed, 50 insertions, 0 deletions
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"; |