From f5d72be57a00f18ed2b18fc2eb6ccedee3544542 Mon Sep 17 00:00:00 2001 From: Wil Stark Date: Fri, 1 Feb 2019 10:15:39 -0800 Subject: VS: Fix deployment for WinCE projects Fixes: #18868 --- Source/cmVisualStudio10TargetGenerator.cxx | 8 +++++++- Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 9d7dd07..0ebfe3b 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -376,7 +376,13 @@ void cmVisualStudio10TargetGenerator::Generate() { Elem e0(BuildFileStream, "Project"); e0.Attribute("DefaultTargets", "Build"); - e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion()); + const char* toolsVersion = this->GlobalGenerator->GetToolsVersion(); + if (this->GlobalGenerator->GetVersion() == + cmGlobalVisualStudioGenerator::VS12 && + this->GlobalGenerator->TargetsWindowsCE()) { + toolsVersion = "4.0"; + } + e0.Attribute("ToolsVersion", toolsVersion); e0.Attribute("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003"); diff --git a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake index c66676f..6ab3833 100644 --- a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake +++ b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake @@ -13,6 +13,7 @@ endif() set(FoundCEAdditionalFiles FALSE) set(FoundRemoteDirectory FALSE) +set(FoundToolsVersion4 FALSE) file(STRINGS "${vcProjectFile}" lines) foreach(line IN LISTS lines) @@ -20,6 +21,8 @@ foreach(line IN LISTS lines) set(FoundCEAdditionalFiles TRUE) elseif(line MATCHES " *[A-Za-z0-9\\]+ *$") set(FoundRemoteDirectory TRUE) + elseif(line MATCHES " * *$") + set(FoundToolsVersion4 TRUE) endif() endforeach() @@ -32,3 +35,8 @@ if(NOT FoundRemoteDirectory) set(RunCMake_TEST_FAILED "RemoteDirectory not found or not set correctly.") return() endif() + +if(NOT FoundToolsVersion4) + set(RunCMake_TEST_FAILED "Failed to find correct ToolsVersion=\"4.0\" .") + return() +endif() -- cgit v0.12