summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-02 13:38:16 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-02 13:38:16 (GMT)
commitfce6233d8be9ed70989875460ee7628f55788554 (patch)
treea52f9aa287bf596928d1f8c278bc6ca09bb76deb /Tests
parentbaed38107eff0da23fc91b18d926fab9a4750f8c (diff)
parent506207f928bfc8853864edb9a200a38e7ac2b02b (diff)
downloadCMake-fce6233d8be9ed70989875460ee7628f55788554.zip
CMake-fce6233d8be9ed70989875460ee7628f55788554.tar.gz
CMake-fce6233d8be9ed70989875460ee7628f55788554.tar.bz2
Merge branch 'csproj_add_free_source_tags' into release
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake23
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake11
-rw-r--r--Tests/RunCMake/VS10Project/foo.cs3
4 files changed, 38 insertions, 0 deletions
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index bc1ec97..3af877f 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -3,3 +3,4 @@ run_cmake(VsConfigurationType)
run_cmake(VsTargetsFileReferences)
run_cmake(VsCustomProps)
run_cmake(VsDebuggerWorkingDir)
+run_cmake(VsCSharpCustomTags)
diff --git a/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake
new file mode 100644
index 0000000..70ea193
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake
@@ -0,0 +1,23 @@
+set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj")
+if(NOT EXISTS "${csProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.")
+ return()
+endif()
+
+set(tagFound FALSE)
+
+set(tagName "MyCustomTag")
+set(tagValue "MyCustomValue")
+
+file(STRINGS "${csProjectFile}" lines)
+foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<${tagName}>${tagValue}</${tagName}>")
+ message(STATUS "foo.csproj has tag ${tagName} with value ${tagValue} defined")
+ set(tagFound TRUE)
+ endif()
+endforeach()
+
+if(NOT tagFound)
+ set(RunCMake_TEST_FAILED "Source file tag ${tagName} with value ${tagValue} not found.")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake b/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake
new file mode 100644
index 0000000..c51e9c3
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake
@@ -0,0 +1,11 @@
+enable_language(CSharp)
+add_library(foo foo.cs)
+
+set(props_file "${CMAKE_CURRENT_SOURCE_DIR}/my.props")
+
+set(tagName "MyCustomTag")
+set(tagValue "MyCustomValue")
+
+set_source_files_properties(foo.cs
+ PROPERTIES
+ VS_CSHARP_${tagName} "${tagValue}")
diff --git a/Tests/RunCMake/VS10Project/foo.cs b/Tests/RunCMake/VS10Project/foo.cs
new file mode 100644
index 0000000..3695dc9
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/foo.cs
@@ -0,0 +1,3 @@
+void foo()
+{
+}