Commit 506207f9 authored by Michael Stürmer's avatar Michael Stürmer Committed by Brad King
Browse files

VS: add test for VS_CSHARP_* source file property

parent a202749c
......@@ -3,3 +3,4 @@ run_cmake(VsConfigurationType)
run_cmake(VsTargetsFileReferences)
run_cmake(VsCustomProps)
run_cmake(VsDebuggerWorkingDir)
run_cmake(VsCSharpCustomTags)
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()
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}")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment