VSCSharpReference-check.cmake 956 B

123456789101112131415161718192021222324252627282930313233343536
  1. file(READ "${RunCMake_TEST_BINARY_DIR}/internal.vcxproj" all_build)
  2. string(REGEX MATCH
  3. "<ProjectReference.Include=.external.csproj.>.*</ProjectReference>"
  4. ProjectReference
  5. ${all_build}
  6. )
  7. if(ProjectReference STREQUAL "")
  8. set(RunCMake_TEST_FAILED "${test} is being set unexpectedly.")
  9. else()
  10. string(REGEX MATCH
  11. "<ReferenceOutputAssembly>.*</ReferenceOutputAssembly>"
  12. ReferenceOutputAssembly
  13. ${ProjectReference}
  14. )
  15. if(NOT ReferenceOutputAssembly STREQUAL "")
  16. string(REPLACE
  17. "<ReferenceOutputAssembly>"
  18. ""
  19. ReferenceOutputAssemblyValue
  20. ${ReferenceOutputAssembly}
  21. )
  22. string(REPLACE
  23. "</ReferenceOutputAssembly>"
  24. ""
  25. ReferenceOutputAssemblyValue
  26. ${ReferenceOutputAssemblyValue}
  27. )
  28. if(ReferenceOutputAssemblyValue MATCHES "[Fa][Ll][Ss][Ee]")
  29. set(RunCMake_TEST_FAILED "Referenced C# project with ReferenceOutputAssembly set to false.")
  30. endif()
  31. endif()
  32. endif()