summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-11 14:14:16 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-05-11 14:14:24 (GMT)
commitd4b1d3d4f01fe067c163791f2f88ac6dad1d323d (patch)
tree25482041982bddca2fc1d193642ffbb81d94f019 /Tests
parent03885463b4a66272c9fd1e7007dd12f7b5b42e74 (diff)
parentfaf44a8cdb122065b2d36ac415561df679a94872 (diff)
downloadCMake-d4b1d3d4f01fe067c163791f2f88ac6dad1d323d.zip
CMake-d4b1d3d4f01fe067c163791f2f88ac6dad1d323d.tar.gz
CMake-d4b1d3d4f01fe067c163791f2f88ac6dad1d323d.tar.bz2
Merge topic 'source_group_forward_slashes'
faf44a8cdb source_group: Support forward slashes in group hierarchy Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4727
Diffstat (limited to 'Tests')
-rw-r--r--Tests/SourceGroups/CMakeLists.txt6
-rw-r--r--Tests/SourceGroups/main.c4
-rw-r--r--Tests/SourceGroups/nested.c4
3 files changed, 13 insertions, 1 deletions
diff --git a/Tests/SourceGroups/CMakeLists.txt b/Tests/SourceGroups/CMakeLists.txt
index a5740bb..d726395 100644
--- a/Tests/SourceGroups/CMakeLists.txt
+++ b/Tests/SourceGroups/CMakeLists.txt
@@ -30,6 +30,9 @@ source_group(Base\\Sub1\\Base FILES bar.c)
# a group without files, is currently not created
source_group(EmptyGroup)
+# Forward slashes can be delimiters too
+source_group(Base/Nested FILES nested.c)
+
set(root ${CMAKE_CURRENT_SOURCE_DIR})
set(tree_files_without_prefix ${root}/sub1/tree_bar.c
@@ -58,4 +61,5 @@ source_group(PREFIX "" FILES ${tree_files_with_empty_prefix} TREE ${root})
add_executable(SourceGroups main.c bar.c foo.c sub1/foo.c sub1/foobar.c baz.c
${tree_files_with_prefix} ${tree_files_without_prefix}
- ${tree_files_with_empty_prefix} README.txt)
+ ${tree_files_with_empty_prefix} README.txt
+ nested.c)
diff --git a/Tests/SourceGroups/main.c b/Tests/SourceGroups/main.c
index 87225f5..f646b49 100644
--- a/Tests/SourceGroups/main.c
+++ b/Tests/SourceGroups/main.c
@@ -12,6 +12,7 @@ extern int tree_empty_prefix_bar(void);
extern int tree_bar(void);
extern int tree_foobar(void);
extern int tree_baz(void);
+extern int nested(void);
int main()
{
@@ -23,5 +24,8 @@ int main()
"tree_empty_prefix_bar: %d\n",
tree_prefix_foo(), tree_prefix_bar(), tree_bar(), tree_foobar(),
tree_baz(), tree_empty_prefix_foo(), tree_empty_prefix_bar());
+
+ printf("nested: %d\n", nested());
+
return 0;
}
diff --git a/Tests/SourceGroups/nested.c b/Tests/SourceGroups/nested.c
new file mode 100644
index 0000000..4e31480
--- /dev/null
+++ b/Tests/SourceGroups/nested.c
@@ -0,0 +1,4 @@
+int nested(void)
+{
+ return 123;
+}