summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-07-07 14:32:20 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-07-07 14:32:31 (GMT)
commitb8b53db1b30d697980bbf361a3f2604e1ff8396b (patch)
tree22e554edce06647432ba10e8016caedceadff8e5 /Tests
parent10a1759a6d98b056d17c372ed0efa380204538b6 (diff)
parent87788353cc1cae7ee3b6f47d5f0f7a46df11d75e (diff)
downloadCMake-b8b53db1b30d697980bbf361a3f2604e1ff8396b.zip
CMake-b8b53db1b30d697980bbf361a3f2604e1ff8396b.tar.gz
CMake-b8b53db1b30d697980bbf361a3f2604e1ff8396b.tar.bz2
Merge topic 'source_group-TREE-no-FILES'
87788353cc source_group: Add test/example for TREE without FILES d85238a2f2 source_group: Fix TREE without FILES Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8599
Diffstat (limited to 'Tests')
-rw-r--r--Tests/SourceGroups/CMakeLists.txt2
-rw-r--r--Tests/SourceGroups/sub2/CMakeLists.txt4
-rw-r--r--Tests/SourceGroups/sub2/main.c11
-rw-r--r--Tests/SourceGroups/sub2/qux.c4
-rw-r--r--Tests/SourceGroups/sub2/subsub/qax.c4
5 files changed, 25 insertions, 0 deletions
diff --git a/Tests/SourceGroups/CMakeLists.txt b/Tests/SourceGroups/CMakeLists.txt
index d726395..550fe9e 100644
--- a/Tests/SourceGroups/CMakeLists.txt
+++ b/Tests/SourceGroups/CMakeLists.txt
@@ -63,3 +63,5 @@ 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
nested.c)
+
+add_subdirectory(sub2)
diff --git a/Tests/SourceGroups/sub2/CMakeLists.txt b/Tests/SourceGroups/sub2/CMakeLists.txt
new file mode 100644
index 0000000..e457bc4
--- /dev/null
+++ b/Tests/SourceGroups/sub2/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_executable(SourceGroups2 main.c
+ qux.c subsub/qax.c)
+
+source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" ) #PREFIX TheSubDir2 )
diff --git a/Tests/SourceGroups/sub2/main.c b/Tests/SourceGroups/sub2/main.c
new file mode 100644
index 0000000..4cd8ae0
--- /dev/null
+++ b/Tests/SourceGroups/sub2/main.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+extern int qax(void);
+extern int qux(void);
+
+int main()
+{
+ printf("qux: %d qax: %d\n", qux(), qax());
+
+ return 0;
+}
diff --git a/Tests/SourceGroups/sub2/qux.c b/Tests/SourceGroups/sub2/qux.c
new file mode 100644
index 0000000..1a8b6f9
--- /dev/null
+++ b/Tests/SourceGroups/sub2/qux.c
@@ -0,0 +1,4 @@
+int qux(void)
+{
+ return 1234;
+}
diff --git a/Tests/SourceGroups/sub2/subsub/qax.c b/Tests/SourceGroups/sub2/subsub/qax.c
new file mode 100644
index 0000000..c1b1042
--- /dev/null
+++ b/Tests/SourceGroups/sub2/subsub/qax.c
@@ -0,0 +1,4 @@
+int qax(void)
+{
+ return 123;
+}