diff options
author | Brad King <brad.king@kitware.com> | 2021-05-14 12:35:27 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-05-14 12:35:36 (GMT) |
commit | 40a7572e4fc6dcd467130b1fa75f4960ba7c15d6 (patch) | |
tree | 404281dfdc86fb3056ebb904f179de1cf3ac941d /Tests | |
parent | ad58b4407ccc04f4871872bed7a8025651518199 (diff) | |
parent | c7aa3bdefc05848666578802da2423efa4f24e26 (diff) | |
download | CMake-40a7572e4fc6dcd467130b1fa75f4960ba7c15d6.zip CMake-40a7572e4fc6dcd467130b1fa75f4960ba7c15d6.tar.gz CMake-40a7572e4fc6dcd467130b1fa75f4960ba7c15d6.tar.bz2 |
Merge topic 'VS-include_external_msproject-CSharp-targets-references'
c7aa3bdefc Tests/include_external_msproject: Check C# project reference
65b58b0316 VS Generator: Properly reference included external C# projects
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6123
Diffstat (limited to 'Tests')
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 +) |