Commit f5d72be5 authored by Wil Stark's avatar Wil Stark Committed by Brad King
Browse files

VS: Fix deployment for WinCE projects

Fixes: #18868
parent 0c61b869
...@@ -376,7 +376,13 @@ void cmVisualStudio10TargetGenerator::Generate() ...@@ -376,7 +376,13 @@ void cmVisualStudio10TargetGenerator::Generate()
{ {
Elem e0(BuildFileStream, "Project"); Elem e0(BuildFileStream, "Project");
e0.Attribute("DefaultTargets", "Build"); 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", e0.Attribute("xmlns",
"http://schemas.microsoft.com/developer/msbuild/2003"); "http://schemas.microsoft.com/developer/msbuild/2003");
......
...@@ -13,6 +13,7 @@ endif() ...@@ -13,6 +13,7 @@ endif()
set(FoundCEAdditionalFiles FALSE) set(FoundCEAdditionalFiles FALSE)
set(FoundRemoteDirectory FALSE) set(FoundRemoteDirectory FALSE)
set(FoundToolsVersion4 FALSE)
file(STRINGS "${vcProjectFile}" lines) file(STRINGS "${vcProjectFile}" lines)
foreach(line IN LISTS lines) foreach(line IN LISTS lines)
...@@ -20,6 +21,8 @@ foreach(line IN LISTS lines) ...@@ -20,6 +21,8 @@ foreach(line IN LISTS lines)
set(FoundCEAdditionalFiles TRUE) set(FoundCEAdditionalFiles TRUE)
elseif(line MATCHES " *<RemoteDirectory>[A-Za-z0-9\\]+</RemoteDirectory> *$") elseif(line MATCHES " *<RemoteDirectory>[A-Za-z0-9\\]+</RemoteDirectory> *$")
set(FoundRemoteDirectory TRUE) set(FoundRemoteDirectory TRUE)
elseif(line MATCHES " *<Project +.*ToolsVersion=\"4.0\".*> *$")
set(FoundToolsVersion4 TRUE)
endif() endif()
endforeach() endforeach()
...@@ -32,3 +35,8 @@ if(NOT FoundRemoteDirectory) ...@@ -32,3 +35,8 @@ if(NOT FoundRemoteDirectory)
set(RunCMake_TEST_FAILED "RemoteDirectory not found or not set correctly.") set(RunCMake_TEST_FAILED "RemoteDirectory not found or not set correctly.")
return() return()
endif() endif()
if(NOT FoundToolsVersion4)
set(RunCMake_TEST_FAILED "Failed to find correct ToolsVersion=\"4.0\" .")
return()
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment