summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-06 10:47:10 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-10-06 10:47:19 (GMT)
commiteb9cf7f72181834f8d200a2a17572c6149490414 (patch)
tree86f06f46f5adba25fb5d1e940be8042c648cd000 /Tests
parent848eb295de4985faaac74fccf4628ca152744f0d (diff)
parent8d87cfdbf34671ad80cf584456dfdb565007f869 (diff)
downloadCMake-eb9cf7f72181834f8d200a2a17572c6149490414.zip
CMake-eb9cf7f72181834f8d200a2a17572c6149490414.tar.gz
CMake-eb9cf7f72181834f8d200a2a17572c6149490414.tar.bz2
Merge topic 'csharp-source_group-bugfix' into release-3.18
8d87cfdbf3 VS: Fix regression in C# source links Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5314
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake9
-rw-r--r--Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake8
-rw-r--r--Tests/RunCMake/VS10Project/VsCsharpSourceGroup.png0
3 files changed, 12 insertions, 5 deletions
diff --git a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake
index 3b5c70f..80d76e4 100644
--- a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake
@@ -9,12 +9,13 @@ file(STRINGS "${csProjFile}" lines)
include(${RunCMake_TEST_SOURCE_DIR}/VsCsharpSourceGroupHelpers.cmake)
set(SOURCE_GROUPS_TO_FIND
- "CSharpSourceGroup"
- "CSharpSourceGroup/nested"
- "Images"
+ "CSharpSourceGroup\\\\foo\\.cs"
+ "CSharpSourceGroup\\\\nested\\\\baz\\.cs"
+ "CSharpSourceGroup\\\\images\\\\empty\\.bmp"
+ "VsCsharpSourceGroup\\.png"
)
-foreach(GROUP_NAME IN LISTS ${SOURCE_GROUPS_TO_FIND})
+foreach(GROUP_NAME IN LISTS SOURCE_GROUPS_TO_FIND)
find_source_group("${lines}" ${GROUP_NAME})
if(NOT ${SOURCE_GROUP_FOUND})
return()
diff --git a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake
index 024993c..510d712 100644
--- a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake
+++ b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake
@@ -9,8 +9,14 @@ set(SRC_FILES
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})
+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})
diff --git a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.png b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.png
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.png