ENH: Add simple exclusion test for subdirectories

This commit is contained in:
Andy Cedilnik 2007-02-22 08:39:12 -05:00
parent 5647e6e254
commit 1db4c0e524
14 changed files with 134 additions and 0 deletions

View File

@ -0,0 +1,8 @@
project(SimpleExclude C)
set(EXECUTABLE_OUTPUT_PATH "${SimpleExclude_BINARY_DIR}" CACHE INTERNAL "" FORCE)
set(LIBRARY_OUTPUT_PATH "${SimpleExclude_BINARY_DIR}" CACHE INTERNAL "" FORCE)
add_subdirectory(dirC EXCLUDE_FROM_ALL)
add_subdirectory(dirD)

View File

@ -0,0 +1,3 @@
add_subdirectory(dirA EXCLUDE_FROM_ALL)
add_subdirectory(dirB)

View File

@ -0,0 +1,10 @@
add_library(t1 t1.c)
add_library(t2 t2.c)
add_executable(t3 t3.c)
add_executable(t4 t4.c)
add_executable(t5 t5.c)
target_link_libraries(t5 t1)

View File

@ -0,0 +1,8 @@
#include <stdio.h>
int tlib1func()
{
Should not be build unless target directory A, B, or C are build;
printf("This is T1\n");
return 5;
}

View File

@ -0,0 +1,7 @@
#include <stdio.h>
int tlib2func()
{
printf("This is T2\n");
return 2;
}

View File

@ -0,0 +1,7 @@
#include <stdio.h>
int main(int argc, char* argv[])
{
Should not be build unless target directory A, B, or C are build;
return 0;
}

View File

@ -0,0 +1,17 @@
#include <stdio.h>
#ifdef __CLASSIC_C__
int main()
{
int ac;
char*av[];
#else
int main(int ac, char*av[])
{
#endif
if(ac > 1000){return *av[0];}
printf("This is T4. This one should work.\n");
return 0;
}

View File

@ -0,0 +1,7 @@
#include <stdio.h>
int main(int argc, char* argv[])
{
Should not be build unless target directory A, B, or C are build;
return 5;
}

View File

@ -0,0 +1,5 @@
add_library(t6 t6.c)
add_library(t7 t7.c)
target_link_libraries(t7 t2)

View File

@ -0,0 +1,8 @@
#include <stdio.h>
int tlib6func()
{
Should not be build unless target directory B, or C are build;
printf("This is T6\n");
return 6;
}

View File

@ -0,0 +1,16 @@
#include <stdio.h>
extern int tlib2func();
int tlib7func()
{
printf("This is T7\n");
if ( tlib2func() != 2 )
{
fprintf(stderr, "Something wrong with T2\n");
return 1;
}
return 7;
}

View File

@ -0,0 +1,7 @@
add_library(t8 t8.c)
add_executable(t9 t9.c)
target_link_libraries(t9 t7)
add_custom_target(t4_custom ALL)
add_dependencies(t4_custom t4)

View File

@ -0,0 +1,7 @@
#include <stdio.h>
int tlib8func()
{
printf("This is T8\n");
return 8;
}

View File

@ -0,0 +1,24 @@
#include <stdio.h>
extern int tlib7func();
#ifdef __CLASSIC_C__
int main()
{
int ac;
char*av[];
#else
int main(int ac, char*av[])
{
#endif
if(ac > 1000){return *av[0];}
printf("This is T9. This one should work.\n");
if ( tlib7func() != 7 )
{
fprintf(stderr, "Something wrong with T7\n");
return 1;
}
return 0;
}