summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake
blob: 0393362d6288df10bdd612d929180a1f477b1b5f (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
#
# Check C# VS project for required elements
#
set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj")
if(NOT EXISTS "${csProjectFile}")
  set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.")
  return()
endif()

file(STRINGS "${csProjectFile}" lines)

set(HAVE_DocumentationFile 0)
foreach(line IN LISTS lines)
  if(line MATCHES "^ *<DocumentationFile>([^<>]+)</DocumentationFile>")
    if(HAVE_DocumentationFile)
      set(RunCMake_TEST_FAILED "Documentation node has been generated more than once for\n  ${csProjectFile}")
      return()
    endif()
    set(HAVE_DocumentationFile 1)
  endif()
endforeach()

if(NOT HAVE_DocumentationFile)
  set(RunCMake_TEST_FAILED "Documentation node has not been generated for\n  ${csProjectFile}")
  return()
endif()