summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake
blob: 6ab3833bf311589d153b989a8127baa602149763 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
if(NOT EXISTS "${vcProjectFile}")
  set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
  return()
endif()


if( NOT ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsCE" )
  set(RunCMake_TEST_FAILED "Test only valid for WindowsCE")
  return()
endif()


set(FoundCEAdditionalFiles FALSE)
set(FoundRemoteDirectory FALSE)
set(FoundToolsVersion4 FALSE)

file(STRINGS "${vcProjectFile}" lines)
foreach(line IN LISTS lines)
  if(line MATCHES "^ *<CEAdditionalFiles> *foo\\.dll\\|\\\\foo\\\\src\\\\dir\\\\on\\\\host\\|\\$\\(RemoteDirectory\\)\\|0;bar\\.dll\\|\\\\bar\\\\src\\\\dir\\|\\$\\(RemoteDirectory\\)bardir\\|0.*</CEAdditionalFiles> *$")
    set(FoundCEAdditionalFiles TRUE)
  elseif(line MATCHES " *<RemoteDirectory>[A-Za-z0-9\\]+</RemoteDirectory> *$")
    set(FoundRemoteDirectory TRUE)
  elseif(line MATCHES " *<Project +.*ToolsVersion=\"4.0\".*> *$")
    set(FoundToolsVersion4 TRUE)
  endif()
endforeach()

if(NOT FoundCEAdditionalFiles)
  set(RunCMake_TEST_FAILED "CEAddionalFiles not found or not set correctly.")
  return()
endif()

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()