summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-31 13:34:17 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-01-31 13:34:24 (GMT)
commit3fd01be56bfa0215bcabbe27f1690654c3755b43 (patch)
treea0d3242805e77f7f7ed7419a4fec5b98ffbafb64 /Tests
parent174693dafe2dcc7dad6394ed051791da39ff05b1 (diff)
parent365e02e73ea9e6177ff5fb6de73e4187eded8afc (diff)
downloadCMake-3fd01be56bfa0215bcabbe27f1690654c3755b43.zip
CMake-3fd01be56bfa0215bcabbe27f1690654c3755b43.tar.gz
CMake-3fd01be56bfa0215bcabbe27f1690654c3755b43.tar.bz2
Merge topic 'source_group-TREE-args'
365e02e7 source_group: Fix TREE argument parsing Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1713
Diffstat (limited to 'Tests')
-rw-r--r--Tests/SourceGroups/CMakeLists.txt10
-rw-r--r--Tests/SourceGroups/main.c7
-rw-r--r--Tests/SourceGroups/tree_empty_prefix_bar.c4
-rw-r--r--Tests/SourceGroups/tree_empty_prefix_foo.c4
4 files changed, 21 insertions, 4 deletions
diff --git a/Tests/SourceGroups/CMakeLists.txt b/Tests/SourceGroups/CMakeLists.txt
index 4e4a030..813774d 100644
--- a/Tests/SourceGroups/CMakeLists.txt
+++ b/Tests/SourceGroups/CMakeLists.txt
@@ -39,9 +39,15 @@ set(tree_files_without_prefix ${root}/sub1/tree_bar.c
set(tree_files_with_prefix ${root}/tree_prefix_foo.c
tree_prefix_bar.c)
+set(tree_files_with_empty_prefix ${root}/tree_empty_prefix_foo.c
+ tree_empty_prefix_bar.c)
+
source_group(TREE ${root} FILES ${tree_files_without_prefix})
-source_group(TREE ${root} PREFIX tree_root/subgroup FILES ${tree_files_with_prefix})
+source_group(FILES ${tree_files_with_prefix} PREFIX tree_root/subgroup TREE ${root})
+
+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} README.txt)
+ ${tree_files_with_prefix} ${tree_files_without_prefix}
+ ${tree_files_with_empty_prefix} README.txt)
diff --git a/Tests/SourceGroups/main.c b/Tests/SourceGroups/main.c
index 4d84cf2..87225f5 100644
--- a/Tests/SourceGroups/main.c
+++ b/Tests/SourceGroups/main.c
@@ -7,6 +7,8 @@ extern int barbar(void);
extern int baz(void);
extern int tree_prefix_foo(void);
extern int tree_prefix_bar(void);
+extern int tree_empty_prefix_foo(void);
+extern int tree_empty_prefix_bar(void);
extern int tree_bar(void);
extern int tree_foobar(void);
extern int tree_baz(void);
@@ -17,8 +19,9 @@ int main()
foobar(), barbar(), baz());
printf("tree_prefix_foo: %d tree_prefix_bar: %d tree_bar: %d tree_foobar: "
- "%d tree_baz: %d\n",
+ "%d tree_baz: %d tree_empty_prefix_foo: %d "
+ "tree_empty_prefix_bar: %d\n",
tree_prefix_foo(), tree_prefix_bar(), tree_bar(), tree_foobar(),
- tree_baz());
+ tree_baz(), tree_empty_prefix_foo(), tree_empty_prefix_bar());
return 0;
}
diff --git a/Tests/SourceGroups/tree_empty_prefix_bar.c b/Tests/SourceGroups/tree_empty_prefix_bar.c
new file mode 100644
index 0000000..d974c6e
--- /dev/null
+++ b/Tests/SourceGroups/tree_empty_prefix_bar.c
@@ -0,0 +1,4 @@
+int tree_empty_prefix_bar(void)
+{
+ return 66;
+}
diff --git a/Tests/SourceGroups/tree_empty_prefix_foo.c b/Tests/SourceGroups/tree_empty_prefix_foo.c
new file mode 100644
index 0000000..277cbd4
--- /dev/null
+++ b/Tests/SourceGroups/tree_empty_prefix_foo.c
@@ -0,0 +1,4 @@
+int tree_empty_prefix_foo(void)
+{
+ return 6;
+}