cmake/Tests/RunCMake/include_external_msproject/VSCSharpReference-check.cmake

37 lines
956 B
CMake
Raw Normal View History

2021-09-14 00:13:48 +02:00
file(READ "${RunCMake_TEST_BINARY_DIR}/internal.vcxproj" all_build)
string(REGEX MATCH
"<ProjectReference.Include=.external.csproj.>.*</ProjectReference>"
ProjectReference
${all_build}
)
if(ProjectReference STREQUAL "")
set(RunCMake_TEST_FAILED "${test} is being set unexpectedly.")
else()
string(REGEX MATCH
"<ReferenceOutputAssembly>.*</ReferenceOutputAssembly>"
ReferenceOutputAssembly
${ProjectReference}
)
if(NOT ReferenceOutputAssembly STREQUAL "")
string(REPLACE
"<ReferenceOutputAssembly>"
""
ReferenceOutputAssemblyValue
${ReferenceOutputAssembly}
)
string(REPLACE
"</ReferenceOutputAssembly>"
""
ReferenceOutputAssemblyValue
${ReferenceOutputAssemblyValue}
)
if(ReferenceOutputAssemblyValue MATCHES "[Fa][Ll][Ss][Ee]")
set(RunCMake_TEST_FAILED "Referenced C# project with ReferenceOutputAssembly set to false.")
endif()
endif()
endif()