cmake/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake

27 lines
782 B
CMake
Raw Normal View History

2020-08-30 11:54:41 +02:00
#
# 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()