From 3abd150ce9df03e24a903dedc952339b58ba79cb Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 29 Jul 2014 11:42:30 -0400 Subject: VS: Save WindowsPhone and WindowsStore system internally Add boolean members to the VS >= 10 global generator to save whether CMAKE_SYSTEM_NAME is WindowsPhone or WindowsStore without having to repeat a string comparison. Inspired-by: Gilles Khouzam --- Source/cmGlobalVisualStudio10Generator.cxx | 10 ++++++++++ Source/cmGlobalVisualStudio10Generator.h | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 4007789..5189569 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; } @@ -148,6 +150,14 @@ bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s, //---------------------------------------------------------------------------- bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile*) { + if(this->SystemName == "WindowsPhone") + { + this->SystemIsWindowsPhone = true; + } + else if(this->SystemName == "WindowsStore") + { + this->SystemIsWindowsStore = true; + } return true; } diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index b042559..e3156bf 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 @@ -108,6 +116,8 @@ protected: std::string DefaultPlatformToolset; std::string SystemName; std::string SystemVersion; + bool SystemIsWindowsPhone; + bool SystemIsWindowsStore; bool ExpressEdition; bool MasmEnabled; -- cgit v0.12 From d7938bff37bfa05f34b9ad5a46ae3aff54955eea Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 28 Jul 2014 16:15:43 -0400 Subject: 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 --- Source/cmGlobalVisualStudio10Generator.cxx | 28 ++++++++++++++++- Source/cmGlobalVisualStudio10Generator.h | 4 +++ Source/cmGlobalVisualStudio11Generator.cxx | 50 ++++++++++++++++++++++++++++++ Source/cmGlobalVisualStudio11Generator.h | 4 +++ Source/cmGlobalVisualStudio12Generator.cxx | 50 ++++++++++++++++++++++++++++++ Source/cmGlobalVisualStudio12Generator.h | 4 +++ 6 files changed, 139 insertions(+), 1 deletion(-) 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 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; -- cgit v0.12 From b94ddf6cd70e811e4bc3f3c28ef7195bcf2bb0cf Mon Sep 17 00:00:00 2001 From: Gilles Khouzam Date: Mon, 28 Jul 2014 14:27:59 -0400 Subject: CMakeDetermineCompilerId: Recognize WindowsPhone and WindowsStore When CMAKE_SYSTEM_NAME is set to target one of these, add ApplicationType and ApplicationTypeRevision elements to the .vcxproj file used to identify the compiler so that the WindowsPhone or WindowsStore toolchains can work. Co-Author: Brad King --- Modules/CMakeDetermineCompilerId.cmake | 12 ++++++++++++ Modules/CompilerId/VS-10.vcxproj.in | 2 ++ 2 files changed, 14 insertions(+) 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 "Windows Phone") + elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(id_system "Windows Store") + else() + set(id_system "") + endif() + if(id_system AND CMAKE_SYSTEM_VERSION) + set(id_system_version "${CMAKE_SYSTEM_VERSION}") + 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 @@ {CAE07175-D007-4FC3-BFE8-47B392814159} CompilerId@id_lang@ Win32Proj + @id_system@ + @id_system_version@ -- cgit v0.12 From aa42a78f523f3db5e849663a7c55d949dd25bfb0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 28 Jul 2014 14:08:10 -0400 Subject: Add WindowsPhone and WindowsStore platform information modules Simply include the "Windows" platform equivalents. This will allow -DCMAKE_SYSTEM_NAME=WindowsPhone or -DCMAKE_SYSTEM_NAME=WindowsStore to select variants of the Windows platform while re-using most of the platform information from "Windows". --- Modules/Platform/WindowsPhone-MSVC-C.cmake | 1 + Modules/Platform/WindowsPhone-MSVC-CXX.cmake | 1 + Modules/Platform/WindowsPhone.cmake | 1 + Modules/Platform/WindowsStore-MSVC-C.cmake | 1 + Modules/Platform/WindowsStore-MSVC-CXX.cmake | 1 + Modules/Platform/WindowsStore.cmake | 1 + 6 files changed, 6 insertions(+) create mode 100644 Modules/Platform/WindowsPhone-MSVC-C.cmake create mode 100644 Modules/Platform/WindowsPhone-MSVC-CXX.cmake create mode 100644 Modules/Platform/WindowsPhone.cmake create mode 100644 Modules/Platform/WindowsStore-MSVC-C.cmake create mode 100644 Modules/Platform/WindowsStore-MSVC-CXX.cmake create mode 100644 Modules/Platform/WindowsStore.cmake 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) -- cgit v0.12 From 592098e2d5a00d396e84d7a5e51ae6c550a21fc6 Mon Sep 17 00:00:00 2001 From: Gilles Khouzam Date: Mon, 28 Jul 2014 14:19:45 -0400 Subject: Define 'WINDOWS_PHONE' and 'WINDOWS_STORE' variables Set one of these when CMAKE_SYSTEM_NAME is "WindowsPhone" or "WindowsStore", respectively. --- Help/manual/cmake-variables.7.rst | 2 ++ Help/variable/WINDOWS_PHONE.rst | 5 +++++ Help/variable/WINDOWS_STORE.rst | 5 +++++ Modules/Platform/Windows.cmake | 4 ++++ 4 files changed, 16 insertions(+) create mode 100644 Help/variable/WINDOWS_PHONE.rst create mode 100644 Help/variable/WINDOWS_STORE.rst 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/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/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 "") -- cgit v0.12 From 1c94558abb653968de6da2cb4672006f31ca0d14 Mon Sep 17 00:00:00 2001 From: Gilles Khouzam Date: Mon, 28 Jul 2014 14:50:57 -0400 Subject: MSVC: Disable incremental linking for WindowsPhone and WindowsStore Do not add a "/INCREMENTAL" flag when using the toolchains for these systems. --- Modules/Platform/Windows-MSVC.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index e51c592..b0d3e49 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -199,10 +199,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) -- cgit v0.12 From c72f0887cee6c3c47f50efb44256476045cf801f Mon Sep 17 00:00:00 2001 From: Paul Annetts Date: Mon, 28 Jul 2014 14:56:13 -0400 Subject: MSVC: Add default WindowsPhone and WindowsStore compile flags Also set the list of standard libraries to empty. --- Modules/Platform/Windows-MSVC.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index b0d3e49..9431e90 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -162,6 +162,10 @@ 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") + set(CMAKE_C_STANDARD_LIBRARIES_INIT "") else() set(_PLATFORM_DEFINES "/DWIN32") -- cgit v0.12 From 2074f5813889680d32c784c3dbdb1bf41be1405f Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 31 Jul 2014 13:08:53 -0400 Subject: MSVC: Add system libs for WindowsPhone and WindowsStore Use the libraries that are added by default by the VS 2013 IDE for Windows Phone and Windows Store projects. --- Modules/Platform/Windows-MSVC.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 9431e90..9d4aca2 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -165,7 +165,11 @@ if(WINCE) elseif(WINDOWS_PHONE OR WINDOWS_STORE) set(_FLAGS_C " /DUNICODE /D_UNICODE") set(_FLAGS_CXX " /DUNICODE /D_UNICODE /GR /EHsc") - set(CMAKE_C_STANDARD_LIBRARIES_INIT "") + 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") -- cgit v0.12 From 72395ab23eee5ed7ff5a8800632869d6ef66f805 Mon Sep 17 00:00:00 2001 From: Gilles Khouzam Date: Tue, 29 Jul 2014 11:43:19 -0400 Subject: VS: Add .sln "Deploy" mark for WindowsPhone and WindowsStore binaries --- Source/cmGlobalVisualStudio11Generator.cxx | 14 ++++++++++++++ Source/cmGlobalVisualStudio11Generator.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 33cfaa1..39bbdc0 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -242,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 0b497db..bbd935c 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -41,6 +41,9 @@ protected: virtual const char* GetIDEVersion() { return "11.0"; } bool UseFolderProperty(); static std::set GetInstalledWindowsCESDKs(); + + /** Return true if the configuration needs to be deployed */ + virtual bool NeedsDeploy(cmTarget::TargetType type) const; private: class Factory; friend class Factory; -- cgit v0.12 From 709cebde66a4251e1a1ed7a90c072f06be691bee Mon Sep 17 00:00:00 2001 From: Gilles Khouzam Date: Thu, 31 Jul 2014 13:22:35 -0400 Subject: VS: Generate WindowsPhone and WindowsStore application types Generate the ApplicationType and ApplicationTypeRevision elements in .vcxproj files. --- Source/cmVisualStudio10TargetGenerator.cxx | 22 ++++++++++++++++++++++ Source/cmVisualStudio10TargetGenerator.h | 1 + 2 files changed, 23 insertions(+) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 18d8951..e9421e3 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -286,6 +286,11 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteString("", 2); (*this->BuildFileStream) << "{" << this->GUID << "}\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,20 @@ 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("", 2); + (*this->BuildFileStream) << (isWindowsPhone ? + "Windows Phone" : "Windows Store") + << "\n"; + this->WriteString("", 2); + (*this->BuildFileStream) << cmVS10EscapeXML(v) + << "\n"; + } +} 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& libVec); -- cgit v0.12 From 401a00d9f98aff9c2f15315945cd4c392ff36d9f Mon Sep 17 00:00:00 2001 From: Gilles Khouzam Date: Thu, 31 Jul 2014 13:24:08 -0400 Subject: VS: Set WindowsPhone and WindowsStore min VS version required Generate the MinimumVisualStudioVersion element in the .vcxproj file based on the version of WindowsPhone or WindowsStore to be targeted. --- Source/cmVisualStudio10TargetGenerator.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index e9421e3..291827a 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2120,5 +2120,17 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() this->WriteString("", 2); (*this->BuildFileStream) << cmVS10EscapeXML(v) << "\n"; + if(v == "8.1") + { + // Visual Studio 12.0 is necessary for building 8.1 apps + this->WriteString("12.0" + "\n", 2); + } + else if (v == "8.0") + { + // Visual Studio 11.0 is necessary for building 8.0 apps + this->WriteString("11.0" + "\n", 2); + } } } -- cgit v0.12 From 5d3d9a22b28e99894dab2fe4fac0279fb422ace4 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 5 Aug 2014 10:49:09 -0400 Subject: Help: Add notes for topic 'vs-windows-phone-and-store' --- Help/release/dev/vs-windows-phone-and-store.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Help/release/dev/vs-windows-phone-and-store.rst 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. -- cgit v0.12