CMake/Tests/RunCMake/VS10Project/VsCsharpSourceGroupHelpers.cmake
Kinan Mahdi ac6b18cd90 CSharp: Add support for source groups with out-of-source builds
This also fixes support for multiple sources of the same name in
different directories.  Add a test for both problems.

Issue: #19505
2020-02-28 11:42:01 -05:00

16 lines
444 B
CMake

function(find_source_group LINES NAME)
set(foundSourceGroupLink 0)
foreach(line IN LISTS LINES)
if(line MATCHES "<Link>${NAME}</Link>")
set(foundSourceGroupLink 1)
endif()
endforeach()
if(NOT foundSourceGroupLink)
set(RunCMake_TEST_FAILED "Source group link for ${NAME} not found." PARENT_SCOPE)
set(SOURCE_GROUP_FOUND 0 PARENT_SCOPE)
return()
endif()
set(SOURCE_GROUP_FOUND 1 PARENT_SCOPE)
endfunction()