mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 19:43:23 +08:00
Tests/include_external_msproject: Check C# project reference
This commit is contained in:
@@ -8,4 +8,5 @@ run_cmake(CustomConfig)
|
||||
|
||||
if(RunCMake_GENERATOR MATCHES "Visual Studio ([^9]|9[0-9])")
|
||||
run_cmake(SkipGetTargetFrameworkProperties)
|
||||
run_cmake(VSCSharpReference)
|
||||
endif()
|
||||
|
@@ -0,0 +1,36 @@
|
||||
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()
|
@@ -0,0 +1,10 @@
|
||||
project(VSCSharpReference)
|
||||
|
||||
include_external_msproject(external external.csproj)
|
||||
|
||||
add_executable(internal
|
||||
main.cpp
|
||||
)
|
||||
add_dependencies(internal
|
||||
external
|
||||
)
|
Reference in New Issue
Block a user