mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-28 01:51:02 -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.
23 lines
825 B
CMake
23 lines
825 B
CMake
enable_language(CSharp)
|
|
set(CMAKE_CONFIGURATION_TYPES Debug)
|
|
|
|
set(SRC_FILES
|
|
${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/foo.cs
|
|
${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/nested/baz.cs
|
|
)
|
|
|
|
set(IMAGE_FILES
|
|
${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/Images/empty.bmp
|
|
)
|
|
# We explicitly don't set a source group for a source in the root level
|
|
# because of https://gitlab.kitware.com/cmake/cmake/-/issues/21221
|
|
set(RESOURCE_FILES
|
|
${CMAKE_CURRENT_SOURCE_DIR}/VsCsharpSourceGroup.png
|
|
)
|
|
|
|
|
|
add_library(VsCsharpSourceGroup SHARED ${SRC_FILES} ${IMAGE_FILES} ${RESOURCE_FILES})
|
|
source_group("CSharpSourceGroup" FILES ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/foo.cs)
|
|
source_group("CSharpSourceGroup/nested" FILES ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/nested/baz.cs)
|
|
source_group("Images" FILES ${IMAGE_FILES})
|