mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-31 03:40:32 -06:00
Fix logic used since commit ac6b18cd90 (CSharp: Add support for source
groups with out-of-source builds, 2020-02-18, v3.18.0-rc1~645^2).
Add a check of the physical file location for C# source groups.
24 lines
654 B
CMake
24 lines
654 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\\\\foo\\.cs"
|
|
"CSharpSourceGroup\\\\nested\\\\baz\\.cs"
|
|
"CSharpSourceGroup\\\\images\\\\empty\\.bmp"
|
|
"VsCsharpSourceGroup\\.png"
|
|
)
|
|
|
|
foreach(GROUP_NAME IN LISTS SOURCE_GROUPS_TO_FIND)
|
|
find_source_group("${lines}" ${GROUP_NAME})
|
|
if(NOT ${SOURCE_GROUP_FOUND})
|
|
return()
|
|
endif()
|
|
endforeach()
|