summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VS10Project
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-08-24 18:14:09 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2022-08-24 20:07:24 (GMT)
commit970052feddcb49f52b49e04a9edd7cb5e9085859 (patch)
treee57a8c955889ef220b6fd9cec1904d19256fa41e /Tests/RunCMake/VS10Project
parentbcc396581387582acec736dcfac577f477f60821 (diff)
downloadCMake-970052feddcb49f52b49e04a9edd7cb5e9085859.zip
CMake-970052feddcb49f52b49e04a9edd7cb5e9085859.tar.gz
CMake-970052feddcb49f52b49e04a9edd7cb5e9085859.tar.bz2
FILE_SET: Fix source group detection
Call MatchChildrenFiles() instead of MatchesFiles() in order to account for files being in subgroups of source groups. Fixes: #23880
Diffstat (limited to 'Tests/RunCMake/VS10Project')
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/VS10Project/SourceGroupFileSet-check.cmake13
-rw-r--r--Tests/RunCMake/VS10Project/SourceGroupFileSet.cmake3
3 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index ee8821a..e540b9f 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -16,6 +16,7 @@ run_cmake(NoImpLib)
run_cmake(RuntimeLibrary)
run_cmake(SourceGroupCMakeLists)
run_cmake(SourceGroupTreeCMakeLists)
+run_cmake(SourceGroupFileSet)
run_cmake(VsConfigurationType)
run_cmake(VsTargetsFileReferences)
run_cmake(VsCustomProps)
diff --git a/Tests/RunCMake/VS10Project/SourceGroupFileSet-check.cmake b/Tests/RunCMake/VS10Project/SourceGroupFileSet-check.cmake
new file mode 100644
index 0000000..fb2eecc
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/SourceGroupFileSet-check.cmake
@@ -0,0 +1,13 @@
+cmake_policy(SET CMP0011 NEW)
+
+set(vcFiltersFile "${RunCMake_TEST_BINARY_DIR}/SourceGroupFileSet.vcxproj.filters")
+if(NOT EXISTS "${vcFiltersFile}")
+ set(RunCMake_TEST_FAILED "Filters file ${vcFiltersFile} does not exist.")
+ return()
+endif()
+
+file(STRINGS "${vcFiltersFile}" lines)
+
+include(${RunCMake_TEST_SOURCE_DIR}/SourceGroupHelpers.cmake)
+
+find_source_group("${lines}" "Header Files\\SourceGroupFileSet")
diff --git a/Tests/RunCMake/VS10Project/SourceGroupFileSet.cmake b/Tests/RunCMake/VS10Project/SourceGroupFileSet.cmake
new file mode 100644
index 0000000..9541687
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/SourceGroupFileSet.cmake
@@ -0,0 +1,3 @@
+add_library(SourceGroupFileSet INTERFACE)
+target_sources(SourceGroupFileSet PUBLIC FILE_SET HEADERS FILES iface.h)
+source_group("Header Files/SourceGroupFileSet" FILES iface.h)