VsCEDebuggerDeploy-check.cmake 1.33 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)
16
set(FoundToolsVersion4 FALSE)
17
18
19
20
21
22
23

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)
24
25
  elseif(line MATCHES " *<Project +.*ToolsVersion=\"4.0\".*> *$")
    set(FoundToolsVersion4 TRUE)
26
27
28
29
30
31
32
33
34
35
36
37
  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()
38
39
40
41
42

if(NOT FoundToolsVersion4)
  set(RunCMake_TEST_FAILED "Failed to find correct ToolsVersion=\"4.0\" .")
  return()
endif()