summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VS10Project
diff options
context:
space:
mode:
authorCharly Mourglia <charly.mourglia@diginext.fr>2019-10-02 19:06:58 (GMT)
committerBrad King <brad.king@kitware.com>2019-10-15 15:44:55 (GMT)
commit89ff3ee779f54e982e96b21b7d370371e639cc6f (patch)
tree0b4b45490228f8f5cfa9ab4986e35f83bbd0787f /Tests/RunCMake/VS10Project
parent60509518124e715994900afa88530558b248510c (diff)
downloadCMake-89ff3ee779f54e982e96b21b7d370371e639cc6f.zip
CMake-89ff3ee779f54e982e96b21b7d370371e639cc6f.tar.gz
CMake-89ff3ee779f54e982e96b21b7d370371e639cc6f.tar.bz2
VS: Add VS_DOTNET_DOCUMENTATION_FILE property
Add a `VS_DOTNET_DOCUMENTATION_FILE` target property to tell VS generators to add a `DocumentationFile` setting in `.csproj` files. Fixes: #19784
Diffstat (limited to 'Tests/RunCMake/VS10Project')
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake26
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake8
3 files changed, 35 insertions, 0 deletions
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 44ccd6b..ebc4d1c 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -15,6 +15,7 @@ run_cmake(VsDebuggerCommand)
run_cmake(VsDebuggerCommandArguments)
run_cmake(VsDebuggerEnvironment)
run_cmake(VsCSharpCustomTags)
+run_cmake(VsCSharpDocumentationFile)
run_cmake(VsCSharpReferenceProps)
run_cmake(VsCSharpWithoutSources)
run_cmake(VsCSharpDeployFiles)
diff --git a/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake
new file mode 100644
index 0000000..0393362
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake
@@ -0,0 +1,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()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake
new file mode 100644
index 0000000..83b6b97
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake
@@ -0,0 +1,8 @@
+set(CMAKE_CONFIGURATION_TYPES Debug)
+enable_language(CSharp)
+
+add_library(foo SHARED
+ foo.cs)
+
+set_target_properties(foo PROPERTIES
+ VS_DOTNET_DOCUMENTATION_FILE foo.xml)