mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-29 04:09:35 +03:00
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:
@@ -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)
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
add_executable(SourceGroups2 main.c
|
||||
qux.c subsub/qax.c)
|
||||
|
||||
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" ) #PREFIX TheSubDir2 )
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
int qux(void)
|
||||
{
|
||||
return 1234;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
int qax(void)
|
||||
{
|
||||
return 123;
|
||||
}
|
||||
Reference in New Issue
Block a user