summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-08-12 14:03:03 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-08-12 14:03:03 (GMT)
commit7365a9fe929c935a194987d3a4a68aff77129a2b (patch)
treec4688c028f66afba7a403b01a2a3ec7ccf98bc30
parent755891c3d92b684e7884ccb3016e5a1da89bbbde (diff)
parent5d3d9a22b28e99894dab2fe4fac0279fb422ace4 (diff)
downloadCMake-7365a9fe929c935a194987d3a4a68aff77129a2b.zip
CMake-7365a9fe929c935a194987d3a4a68aff77129a2b.tar.gz
CMake-7365a9fe929c935a194987d3a4a68aff77129a2b.tar.bz2
Merge topic 'vs-windows-phone-and-store'
5d3d9a22 Help: Add notes for topic 'vs-windows-phone-and-store' 401a00d9 VS: Set WindowsPhone and WindowsStore min VS version required 709cebde VS: Generate WindowsPhone and WindowsStore application types 72395ab2 VS: Add .sln "Deploy" mark for WindowsPhone and WindowsStore binaries 2074f581 MSVC: Add system libs for WindowsPhone and WindowsStore c72f0887 MSVC: Add default WindowsPhone and WindowsStore compile flags 1c94558a MSVC: Disable incremental linking for WindowsPhone and WindowsStore 592098e2 Define 'WINDOWS_PHONE' and 'WINDOWS_STORE' variables aa42a78f Add WindowsPhone and WindowsStore platform information modules b94ddf6c CMakeDetermineCompilerId: Recognize WindowsPhone and WindowsStore d7938bff VS: Select WindowsPhone and WindowsStore default toolsets 3abd150c VS: Save WindowsPhone and WindowsStore system internally
-rw-r--r--Help/manual/cmake-variables.7.rst2
-rw-r--r--Help/release/dev/vs-windows-phone-and-store.rst10
-rw-r--r--Help/variable/WINDOWS_PHONE.rst5
-rw-r--r--Help/variable/WINDOWS_STORE.rst5
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake12
-rw-r--r--Modules/CompilerId/VS-10.vcxproj.in2
-rw-r--r--Modules/Platform/Windows-MSVC.cmake18
-rw-r--r--Modules/Platform/Windows.cmake4
-rw-r--r--Modules/Platform/WindowsPhone-MSVC-C.cmake1
-rw-r--r--Modules/Platform/WindowsPhone-MSVC-CXX.cmake1
-rw-r--r--Modules/Platform/WindowsPhone.cmake1
-rw-r--r--Modules/Platform/WindowsStore-MSVC-C.cmake1
-rw-r--r--Modules/Platform/WindowsStore-MSVC-CXX.cmake1
-rw-r--r--Modules/Platform/WindowsStore.cmake1
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx38
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h14
-rw-r--r--Source/cmGlobalVisualStudio11Generator.cxx64
-rw-r--r--Source/cmGlobalVisualStudio11Generator.h7
-rw-r--r--Source/cmGlobalVisualStudio12Generator.cxx50
-rw-r--r--Source/cmGlobalVisualStudio12Generator.h4
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx34
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h1
22 files changed, 271 insertions, 5 deletions
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 05a7b33..e622784 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -190,6 +190,8 @@ Variables that Describe the System
/variable/MSVC_VERSION
/variable/UNIX
/variable/WIN32
+ /variable/WINDOWS_PHONE
+ /variable/WINDOWS_STORE
/variable/XCODE_VERSION
Variables that Control the Build
diff --git a/Help/release/dev/vs-windows-phone-and-store.rst b/Help/release/dev/vs-windows-phone-and-store.rst
new file mode 100644
index 0000000..b44e276
--- /dev/null
+++ b/Help/release/dev/vs-windows-phone-and-store.rst
@@ -0,0 +1,10 @@
+vs-windows-phone-and-store
+--------------------------
+
+* Generators for Visual Studio 11 (2012) and above learned to generate
+ projects for Windows Phone and Windows Store. One may set the
+ :variable:`CMAKE_SYSTEM_NAME` variable to ``WindowsPhone``
+ or ``WindowsStore`` on the :manual:`cmake(1)` command-line
+ or in a :variable:`CMAKE_TOOLCHAIN_FILE` to activate these platforms.
+ Also set :variable:`CMAKE_SYSTEM_VERSION` to ``8.0`` or ``8.1`` to
+ specify the version of Windows to be targeted.
diff --git a/Help/variable/WINDOWS_PHONE.rst b/Help/variable/WINDOWS_PHONE.rst
new file mode 100644
index 0000000..61d91b0
--- /dev/null
+++ b/Help/variable/WINDOWS_PHONE.rst
@@ -0,0 +1,5 @@
+WINDOWS_PHONE
+-------------
+
+True when the :variable:`CMAKE_SYSTEM_NAME` variable is set
+to ``WindowsPhone``.
diff --git a/Help/variable/WINDOWS_STORE.rst b/Help/variable/WINDOWS_STORE.rst
new file mode 100644
index 0000000..dae3b53
--- /dev/null
+++ b/Help/variable/WINDOWS_STORE.rst
@@ -0,0 +1,5 @@
+WINDOWS_STORE
+-------------
+
+True when the :variable:`CMAKE_SYSTEM_NAME` variable is set
+to ``WindowsStore``.
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 025d296..a780fa6 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -168,6 +168,18 @@ Id flags: ${testflags}
else()
set(id_toolset "")
endif()
+ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
+ set(id_system "<ApplicationType>Windows Phone</ApplicationType>")
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set(id_system "<ApplicationType>Windows Store</ApplicationType>")
+ else()
+ set(id_system "")
+ endif()
+ if(id_system AND CMAKE_SYSTEM_VERSION)
+ set(id_system_version "<ApplicationTypeRevision>${CMAKE_SYSTEM_VERSION}</ApplicationTypeRevision>")
+ else()
+ set(id_system_version "")
+ endif()
if(CMAKE_VS_WINCE_VERSION)
set(id_entrypoint "mainACRTStartup")
if("${vs_version}" VERSION_LESS 9)
diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in
index 1a7a539..bacbca4 100644
--- a/Modules/CompilerId/VS-10.vcxproj.in
+++ b/Modules/CompilerId/VS-10.vcxproj.in
@@ -10,6 +10,8 @@
<ProjectGuid>{CAE07175-D007-4FC3-BFE8-47B392814159}</ProjectGuid>
<RootNamespace>CompilerId@id_lang@</RootNamespace>
<Keyword>Win32Proj</Keyword>
+ @id_system@
+ @id_system_version@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'" Label="Configuration">
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index e51c592..9d4aca2 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -162,6 +162,14 @@ if(WINCE)
if (MSVC_VERSION LESS 1600)
set(CMAKE_C_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT} corelibc.lib")
endif ()
+elseif(WINDOWS_PHONE OR WINDOWS_STORE)
+ set(_FLAGS_C " /DUNICODE /D_UNICODE")
+ set(_FLAGS_CXX " /DUNICODE /D_UNICODE /GR /EHsc")
+ if(WINDOWS_PHONE)
+ set(CMAKE_C_STANDARD_LIBRARIES_INIT "WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib")
+ else()
+ set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib")
+ endif()
else()
set(_PLATFORM_DEFINES "/DWIN32")
@@ -199,10 +207,12 @@ unset(_MACHINE_ARCH_FLAG)
# add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype
# on versions that support it
set( MSVC_INCREMENTAL_YES_FLAG "")
-if(NOT MSVC_INCREMENTAL_DEFAULT)
- set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES")
-else()
- set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL" )
+if(NOT WINDOWS_PHONE AND NOT WINDOWS_STORE)
+ if(NOT MSVC_INCREMENTAL_DEFAULT)
+ set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES")
+ else()
+ set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL" )
+ endif()
endif()
if (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake
index 7e97111..9a937a7 100644
--- a/Modules/Platform/Windows.cmake
+++ b/Modules/Platform/Windows.cmake
@@ -2,6 +2,10 @@ set(WIN32 1)
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsCE")
set(WINCE 1)
+elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
+ set(WINDOWS_PHONE 1)
+elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set(WINDOWS_STORE 1)
endif()
set(CMAKE_STATIC_LIBRARY_PREFIX "")
diff --git a/Modules/Platform/WindowsPhone-MSVC-C.cmake b/Modules/Platform/WindowsPhone-MSVC-C.cmake
new file mode 100644
index 0000000..ce8060b
--- /dev/null
+++ b/Modules/Platform/WindowsPhone-MSVC-C.cmake
@@ -0,0 +1 @@
+include(Platform/Windows-MSVC-C)
diff --git a/Modules/Platform/WindowsPhone-MSVC-CXX.cmake b/Modules/Platform/WindowsPhone-MSVC-CXX.cmake
new file mode 100644
index 0000000..281eadc
--- /dev/null
+++ b/Modules/Platform/WindowsPhone-MSVC-CXX.cmake
@@ -0,0 +1 @@
+include(Platform/Windows-MSVC-CXX)
diff --git a/Modules/Platform/WindowsPhone.cmake b/Modules/Platform/WindowsPhone.cmake
new file mode 100644
index 0000000..65b2eae
--- /dev/null
+++ b/Modules/Platform/WindowsPhone.cmake
@@ -0,0 +1 @@
+include(Platform/Windows)
diff --git a/Modules/Platform/WindowsStore-MSVC-C.cmake b/Modules/Platform/WindowsStore-MSVC-C.cmake
new file mode 100644
index 0000000..ce8060b
--- /dev/null
+++ b/Modules/Platform/WindowsStore-MSVC-C.cmake
@@ -0,0 +1 @@
+include(Platform/Windows-MSVC-C)
diff --git a/Modules/Platform/WindowsStore-MSVC-CXX.cmake b/Modules/Platform/WindowsStore-MSVC-CXX.cmake
new file mode 100644
index 0000000..281eadc
--- /dev/null
+++ b/Modules/Platform/WindowsStore-MSVC-CXX.cmake
@@ -0,0 +1 @@
+include(Platform/Windows-MSVC-CXX)
diff --git a/Modules/Platform/WindowsStore.cmake b/Modules/Platform/WindowsStore.cmake
new file mode 100644
index 0000000..65b2eae
--- /dev/null
+++ b/Modules/Platform/WindowsStore.cmake
@@ -0,0 +1 @@
+include(Platform/Windows)
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 4007789..c708a08 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -97,6 +97,8 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0\\Setup\\VC;"
"ProductDir", vc10Express, cmSystemTools::KeyWOW64_32);
+ this->SystemIsWindowsPhone = false;
+ this->SystemIsWindowsStore = false;
this->MasmEnabled = false;
this->MSBuildCommandInitialized = false;
}
@@ -146,12 +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 b042559..6245b28 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -70,6 +70,14 @@ public:
/** Return the CMAKE_SYSTEM_VERSION. */
std::string const& GetSystemVersion() const { return this->SystemVersion; }
+ /** Return true if building for WindowsPhone */
+ bool TargetsWindowsPhone() const
+ { return this->SystemIsWindowsPhone; }
+
+ /** Return true if building for WindowsStore */
+ bool TargetsWindowsStore() const
+ { return this->SystemIsWindowsStore; }
+
/**
* Where does this version of Visual Studio look for macros for the
* current user? Returns the empty string if this version of Visual
@@ -99,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"; }
@@ -108,6 +120,8 @@ protected:
std::string DefaultPlatformToolset;
std::string SystemName;
std::string SystemVersion;
+ bool SystemIsWindowsPhone;
+ bool SystemIsWindowsStore;
bool ExpressEdition;
bool MasmEnabled;
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index e5a159b..39bbdc0 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";
@@ -192,3 +242,17 @@ cmGlobalVisualStudio11Generator::GetInstalledWindowsCESDKs()
return ret;
}
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio11Generator::NeedsDeploy(cmTarget::TargetType type) const
+{
+ if((type == cmTarget::EXECUTABLE ||
+ type == cmTarget::SHARED_LIBRARY) &&
+ (this->SystemIsWindowsPhone ||
+ this->SystemIsWindowsStore))
+ {
+ return true;
+ }
+ return cmGlobalVisualStudio10Generator::NeedsDeploy(type);
+}
diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h
index 3d89a94..bbd935c 100644
--- a/Source/cmGlobalVisualStudio11Generator.h
+++ b/Source/cmGlobalVisualStudio11Generator.h
@@ -34,9 +34,16 @@ 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();
+
+ /** Return true if the configuration needs to be deployed */
+ virtual bool NeedsDeploy(cmTarget::TargetType type) const;
private:
class Factory;
friend class Factory;
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;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 18d8951..291827a 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -286,6 +286,11 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteString("<ProjectGUID>", 2);
(*this->BuildFileStream) << "{" << this->GUID << "}</ProjectGUID>\n";
+ if(this->MSTools && this->Target->GetType() <= cmTarget::UTILITY)
+ {
+ this->WriteApplicationTypeSettings();
+ }
+
const char* vsProjectTypes =
this->Target->GetProperty("VS_GLOBAL_PROJECT_TYPES");
if(vsProjectTypes)
@@ -2100,3 +2105,32 @@ bool cmVisualStudio10TargetGenerator::
expectedResxHeaders.find(headerFile);
return it != expectedResxHeaders.end();
}
+
+void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
+{
+ bool const isWindowsPhone = this->GlobalGenerator->TargetsWindowsPhone();
+ bool const isWindowsStore = this->GlobalGenerator->TargetsWindowsStore();
+ std::string const& v = this->GlobalGenerator->GetSystemVersion();
+ if(isWindowsPhone || isWindowsStore)
+ {
+ this->WriteString("<ApplicationType>", 2);
+ (*this->BuildFileStream) << (isWindowsPhone ?
+ "Windows Phone" : "Windows Store")
+ << "</ApplicationType>\n";
+ this->WriteString("<ApplicationTypeRevision>", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(v)
+ << "</ApplicationTypeRevision>\n";
+ if(v == "8.1")
+ {
+ // Visual Studio 12.0 is necessary for building 8.1 apps
+ this->WriteString("<MinimumVisualStudioVersion>12.0"
+ "</MinimumVisualStudioVersion>\n", 2);
+ }
+ else if (v == "8.0")
+ {
+ // Visual Studio 11.0 is necessary for building 8.0 apps
+ this->WriteString("<MinimumVisualStudioVersion>11.0"
+ "</MinimumVisualStudioVersion>\n", 2);
+ }
+ }
+}
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 7436372..2bbdb8c 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -91,6 +91,7 @@ private:
void WriteCustomCommand(cmSourceFile const* sf);
void WriteGroups();
void WriteProjectReferences();
+ void WriteApplicationTypeSettings();
bool OutputSourceSpecificFlags(cmSourceFile const* source);
void AddLibraries(cmComputeLinkInformation& cli,
std::vector<std::string>& libVec);