mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 15:20:56 -06:00
This also fixes support for multiple sources of the same name in different directories. Add a test for both problems. Issue: #19505
23 lines
564 B
CMake
23 lines
564 B
CMake
set(csProjFile "${RunCMake_TEST_BINARY_DIR}/VsCsharpSourceGroup.csproj")
|
|
if(NOT EXISTS "${csProjFile}")
|
|
set(RunCMake_TEST_FAILED "Project file ${csProjFile} does not exist.")
|
|
return()
|
|
endif()
|
|
|
|
file(STRINGS "${csProjFile}" lines)
|
|
|
|
include(${RunCMake_TEST_SOURCE_DIR}/VsCsharpSourceGroupHelpers.cmake)
|
|
|
|
set(SOURCE_GROUPS_TO_FIND
|
|
"CSharpSourceGroup"
|
|
"CSharpSourceGroup/nested"
|
|
"Images"
|
|
)
|
|
|
|
foreach(GROUP_NAME IN LISTS ${SOURCE_GROUPS_TO_FIND})
|
|
find_source_group("${lines}" ${GROUP_NAME})
|
|
if(NOT ${SOURCE_GROUP_FOUND})
|
|
return()
|
|
endif()
|
|
endforeach()
|