VS: Select Windows 10 Store SDK and toolset for VS 2015
This commit is contained in:
parent
458121116a
commit
d1b87d72f9
|
@ -120,6 +120,34 @@ bool cmGlobalVisualStudio14Generator::InitializeWindows(cmMakefile* mf)
|
|||
return true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmGlobalVisualStudio14Generator::InitializeWindowsStore(cmMakefile* mf)
|
||||
{
|
||||
std::ostringstream e;
|
||||
if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset))
|
||||
{
|
||||
if(this->DefaultPlatformToolset.empty())
|
||||
{
|
||||
e << this->GetName() << " supports Windows Store '8.0', '8.1' and "
|
||||
"'10.0', but not '" << this->SystemVersion <<
|
||||
"'. Check CMAKE_SYSTEM_VERSION.";
|
||||
}
|
||||
else
|
||||
{
|
||||
e << "A Windows Store component with CMake requires both the Windows "
|
||||
<< "Desktop SDK as well as the Windows Store '" << this->SystemVersion
|
||||
<< "' SDK. Please make sure that you have both installed";
|
||||
}
|
||||
mf->IssueMessage(cmake::FATAL_ERROR, e.str());
|
||||
return false;
|
||||
}
|
||||
if (cmHasLiteralPrefix(this->SystemVersion, "10.0"))
|
||||
{
|
||||
return this->SelectWindows10SDK(mf);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf)
|
||||
{
|
||||
|
@ -138,6 +166,28 @@ bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf)
|
|||
return true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
cmGlobalVisualStudio14Generator::SelectWindowsStoreToolset(
|
||||
std::string& toolset) const
|
||||
{
|
||||
if (cmHasLiteralPrefix(this->SystemVersion, "10.0"))
|
||||
{
|
||||
if (this->IsWindowsStoreToolsetInstalled() &&
|
||||
this->IsWindowsDesktopToolsetInstalled())
|
||||
{
|
||||
toolset = "v140";
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return
|
||||
this->cmGlobalVisualStudio12Generator::SelectWindowsStoreToolset(toolset);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmGlobalVisualStudio14Generator::WriteSLNHeader(std::ostream& fout)
|
||||
{
|
||||
|
@ -166,6 +216,19 @@ cmGlobalVisualStudio14Generator::IsWindowsDesktopToolsetInstalled() const
|
|||
vc14, cmSystemTools::KeyWOW64_32);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
cmGlobalVisualStudio14Generator::IsWindowsStoreToolsetInstalled() const
|
||||
{
|
||||
const char universal10Key[] =
|
||||
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
|
||||
"VisualStudio\\14.0\\Setup\\Build Tools for Windows 10;SrcPath";
|
||||
|
||||
std::string win10SDK;
|
||||
return cmSystemTools::ReadRegistryValue(universal10Key,
|
||||
win10SDK, cmSystemTools::KeyWOW64_32);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion()
|
||||
{
|
||||
|
|
|
@ -31,6 +31,13 @@ public:
|
|||
virtual const char* GetToolsVersion() { return "14.0"; }
|
||||
protected:
|
||||
virtual bool InitializeWindows(cmMakefile* mf);
|
||||
virtual bool InitializeWindowsStore(cmMakefile* mf);
|
||||
virtual bool SelectWindowsStoreToolset(std::string& toolset) const;
|
||||
|
||||
// These aren't virtual because we need to check if the selected version
|
||||
// of the toolset is installed
|
||||
bool IsWindowsStoreToolsetInstalled() const;
|
||||
|
||||
virtual const char* GetIDEVersion() { return "14.0"; }
|
||||
virtual bool SelectWindows10SDK(cmMakefile* mf);
|
||||
|
||||
|
|
Loading…
Reference in New Issue