source_group: Add test/example for TREE without FILES

This creates an additional target and for its three source files
a directory tree is created.
This commit is contained in:
Alex Neundorf
2023-07-05 07:54:54 -04:00
committed by Brad King
parent d85238a2f2
commit 87788353cc
5 changed files with 25 additions and 0 deletions
+2
View File
@@ -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)
+4
View File
@@ -0,0 +1,4 @@
add_executable(SourceGroups2 main.c
qux.c subsub/qax.c)
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" ) #PREFIX TheSubDir2 )
+11
View File
@@ -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;
}
+4
View File
@@ -0,0 +1,4 @@
int qux(void)
{
return 1234;
}
+4
View File
@@ -0,0 +1,4 @@
int qax(void)
{
return 123;
}