diff options
author | Dario Passet <dario.passet@txtgroup.com> | 2021-05-13 16:38:01 (GMT) |
---|---|---|
committer | Dario Passet <dario.passet@txtgroup.com> | 2021-05-13 16:38:01 (GMT) |
commit | c7aa3bdefc05848666578802da2423efa4f24e26 (patch) | |
tree | a8d8b1138581a5f41fb5edd1433e86ab664469ef /Tests/RunCMake/include_external_msproject | |
parent | 65b58b0316598d03c6865a11203c3ac5b8ba36a4 (diff) | |
download | CMake-c7aa3bdefc05848666578802da2423efa4f24e26.zip CMake-c7aa3bdefc05848666578802da2423efa4f24e26.tar.gz CMake-c7aa3bdefc05848666578802da2423efa4f24e26.tar.bz2 |
Tests/include_external_msproject: Check C# project reference
Diffstat (limited to 'Tests/RunCMake/include_external_msproject')
3 files changed, 47 insertions, 0 deletions
diff --git a/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake b/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake index 7ed0773..cb0eb18 100644 --- a/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake +++ b/Tests/RunCMake/include_external_msproject/RunCMakeTest.cmake @@ -8,4 +8,5 @@ run_cmake(CustomConfig) if(RunCMake_GENERATOR MATCHES "Visual Studio ([^9]|9[0-9])") run_cmake(SkipGetTargetFrameworkProperties) + run_cmake(VSCSharpReference) endif() diff --git a/Tests/RunCMake/include_external_msproject/VSCSharpReference-check.cmake b/Tests/RunCMake/include_external_msproject/VSCSharpReference-check.cmake new file mode 100644 index 0000000..71b8c1f --- /dev/null +++ b/Tests/RunCMake/include_external_msproject/VSCSharpReference-check.cmake @@ -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() diff --git a/Tests/RunCMake/include_external_msproject/VSCSharpReference.cmake b/Tests/RunCMake/include_external_msproject/VSCSharpReference.cmake new file mode 100644 index 0000000..6229e61 --- /dev/null +++ b/Tests/RunCMake/include_external_msproject/VSCSharpReference.cmake @@ -0,0 +1,10 @@ +project(VSCSharpReference) + +include_external_msproject(external external.csproj) + +add_executable(internal + main.cpp +) +add_dependencies(internal + external +) |