summaryrefslogtreecommitdiff
path: root/Tests/SubDir
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/SubDir')
-rw-r--r--Tests/SubDir/AnotherSubdir/pair+int.int.c6
-rw-r--r--Tests/SubDir/AnotherSubdir/pair_int.int.c6
-rw-r--r--Tests/SubDir/AnotherSubdir/secondone.c6
-rw-r--r--Tests/SubDir/AnotherSubdir/testfromsubdir.c14
-rw-r--r--Tests/SubDir/CMakeLists.txt46
-rw-r--r--Tests/SubDir/Examples/CMakeLists.txt3
-rw-r--r--Tests/SubDir/Examples/example1/CMakeLists.txt7
-rw-r--r--Tests/SubDir/Examples/example1/example1.cxx7
-rw-r--r--Tests/SubDir/Examples/example2/CMakeLists.txt2
-rw-r--r--Tests/SubDir/Examples/example2/example2.cxx7
-rw-r--r--Tests/SubDir/Executable/CMakeLists.txt1
-rw-r--r--Tests/SubDir/Executable/test.cxx49
-rw-r--r--Tests/SubDir/ThirdSubDir/pair+int.int1.c6
-rw-r--r--Tests/SubDir/ThirdSubDir/pair_int.int1.c6
-rw-r--r--Tests/SubDir/ThirdSubDir/pair_p_int.int1.c6
-rw-r--r--Tests/SubDir/ThirdSubDir/testfromauxsubdir.c16
-rw-r--r--Tests/SubDir/ThirdSubDir/thirdone.c6
-rw-r--r--Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c6
-rw-r--r--Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c6
19 files changed, 206 insertions, 0 deletions
diff --git a/Tests/SubDir/AnotherSubdir/pair+int.int.c b/Tests/SubDir/AnotherSubdir/pair+int.int.c
new file mode 100644
index 0000000000..b7a6237818
--- /dev/null
+++ b/Tests/SubDir/AnotherSubdir/pair+int.int.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void pair_stuff()
+{
+ printf("Placeholder for a strange file in subdirectory\n");
+}
diff --git a/Tests/SubDir/AnotherSubdir/pair_int.int.c b/Tests/SubDir/AnotherSubdir/pair_int.int.c
new file mode 100644
index 0000000000..b7a6237818
--- /dev/null
+++ b/Tests/SubDir/AnotherSubdir/pair_int.int.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void pair_stuff()
+{
+ printf("Placeholder for a strange file in subdirectory\n");
+}
diff --git a/Tests/SubDir/AnotherSubdir/secondone.c b/Tests/SubDir/AnotherSubdir/secondone.c
new file mode 100644
index 0000000000..3e9e5afe6b
--- /dev/null
+++ b/Tests/SubDir/AnotherSubdir/secondone.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void secondone()
+{
+ printf("Hello again\n");
+}
diff --git a/Tests/SubDir/AnotherSubdir/testfromsubdir.c b/Tests/SubDir/AnotherSubdir/testfromsubdir.c
new file mode 100644
index 0000000000..34b6e7a88d
--- /dev/null
+++ b/Tests/SubDir/AnotherSubdir/testfromsubdir.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+
+void secondone();
+void pair_stuff();
+void vcl_stuff();
+
+int main()
+{
+ printf("Hello from subdirectory\n");
+ secondone();
+ pair_stuff();
+ vcl_stuff();
+ return 0;
+}
diff --git a/Tests/SubDir/CMakeLists.txt b/Tests/SubDir/CMakeLists.txt
new file mode 100644
index 0000000000..9cfbe25ce0
--- /dev/null
+++ b/Tests/SubDir/CMakeLists.txt
@@ -0,0 +1,46 @@
+cmake_minimum_required (VERSION 2.6)
+PROJECT(SUBDIR)
+SUBDIRS(Executable EXCLUDE_FROM_ALL Examples)
+WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
+#WATCOM WMAKE does not support + in the name of a file!
+IF(WATCOM)
+ SET(PLUS_NAME_FILES
+ AnotherSubdir/pair_int.int.c
+ vcl_algorithm_vcl_pair_double.foo.c)
+ELSE(WATCOM)
+ SET(PLUS_NAME_FILES
+ AnotherSubdir/pair+int.int.c
+ vcl_algorithm+vcl_pair+double.foo.c)
+ENDIF(WATCOM)
+
+ADD_EXECUTABLE(TestFromSubdir
+ AnotherSubdir/testfromsubdir.c
+ AnotherSubdir/secondone
+ ${PLUS_NAME_FILES}
+ )
+
+AUX_SOURCE_DIRECTORY(ThirdSubDir SOURCES)
+IF(WATCOM)
+ FOREACH(f ${SOURCES})
+ IF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
+ ELSE("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
+ SET(SOURCES2 ${f} ${SOURCES2})
+ ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
+ ENDFOREACH(f)
+ SET(SOURCES ${SOURCES2})
+ SET(SOURCES ${SOURCES}
+ vcl_algorithm_vcl_pair_double.foo.c)
+ELSE(WATCOM)
+ FOREACH(f ${SOURCES})
+ IF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
+ ELSE("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
+ SET(SOURCES2 ${f} ${SOURCES2})
+ MESSAGE("${f}")
+ ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
+ ENDFOREACH(f)
+ SET(SOURCES ${SOURCES2})
+ SET(SOURCES ${SOURCES}
+ vcl_algorithm+vcl_pair+double.foo.c)
+ENDIF(WATCOM)
+MESSAGE("Sources: ${SOURCES}")
+ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES})
diff --git a/Tests/SubDir/Examples/CMakeLists.txt b/Tests/SubDir/Examples/CMakeLists.txt
new file mode 100644
index 0000000000..b0f1e896c8
--- /dev/null
+++ b/Tests/SubDir/Examples/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required (VERSION 2.6)
+PROJECT(Examples)
+SUBDIRS(example1 example2)
diff --git a/Tests/SubDir/Examples/example1/CMakeLists.txt b/Tests/SubDir/Examples/example1/CMakeLists.txt
new file mode 100644
index 0000000000..3036183211
--- /dev/null
+++ b/Tests/SubDir/Examples/example1/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required (VERSION 2.6)
+PROJECT(example1)
+ADD_EXECUTABLE(example1 example1.cxx)
+
+ADD_CUSTOM_COMMAND(TARGET example1 POST_BUILD
+ COMMAND "${CMAKE_COMMAND}" ARGS -E remove ${SUBDIR_BINARY_DIR}/ShouldBeHere
+ COMMENT "Remove marker file that should exist because this should not be run")
diff --git a/Tests/SubDir/Examples/example1/example1.cxx b/Tests/SubDir/Examples/example1/example1.cxx
new file mode 100644
index 0000000000..3c4819415c
--- /dev/null
+++ b/Tests/SubDir/Examples/example1/example1.cxx
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main()
+{
+ printf("example1\n");
+ return 0;
+}
diff --git a/Tests/SubDir/Examples/example2/CMakeLists.txt b/Tests/SubDir/Examples/example2/CMakeLists.txt
new file mode 100644
index 0000000000..19a537686e
--- /dev/null
+++ b/Tests/SubDir/Examples/example2/CMakeLists.txt
@@ -0,0 +1,2 @@
+PROJECT(example2)
+ADD_EXECUTABLE(example2 example2.cxx)
diff --git a/Tests/SubDir/Examples/example2/example2.cxx b/Tests/SubDir/Examples/example2/example2.cxx
new file mode 100644
index 0000000000..60ef3c940e
--- /dev/null
+++ b/Tests/SubDir/Examples/example2/example2.cxx
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main()
+{
+ printf("example2\n");
+ return 0;
+}
diff --git a/Tests/SubDir/Executable/CMakeLists.txt b/Tests/SubDir/Executable/CMakeLists.txt
new file mode 100644
index 0000000000..d679168d8a
--- /dev/null
+++ b/Tests/SubDir/Executable/CMakeLists.txt
@@ -0,0 +1 @@
+ADD_EXECUTABLE(test test.cxx)
diff --git a/Tests/SubDir/Executable/test.cxx b/Tests/SubDir/Executable/test.cxx
new file mode 100644
index 0000000000..c528fb1664
--- /dev/null
+++ b/Tests/SubDir/Executable/test.cxx
@@ -0,0 +1,49 @@
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+// return true if the file exists
+int FileExists(const char* filename)
+{
+#ifdef _MSC_VER
+# define access _access
+#endif
+#ifndef F_OK
+#define F_OK 0
+#endif
+ if ( access(filename, F_OK) != 0 )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+}
+
+
+int main(int ac, char** av)
+{
+ if(ac <= 1)
+ {
+ printf("Usage: %s <file>\n", av[0]);
+ return 1;
+ }
+ if(!FileExists(av[1]))
+ {
+ printf("Missing file %s\n", av[1]);
+ return 1;
+ }
+ if(FileExists(av[2]))
+ {
+ printf("File %s should be in subdirectory\n", av[2]);
+ return 1;
+ }
+ printf("%s is not there! Good.", av[2]);
+ printf("%s is there! Good.", av[1]);
+ return 0;
+}
diff --git a/Tests/SubDir/ThirdSubDir/pair+int.int1.c b/Tests/SubDir/ThirdSubDir/pair+int.int1.c
new file mode 100644
index 0000000000..b7a6237818
--- /dev/null
+++ b/Tests/SubDir/ThirdSubDir/pair+int.int1.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void pair_stuff()
+{
+ printf("Placeholder for a strange file in subdirectory\n");
+}
diff --git a/Tests/SubDir/ThirdSubDir/pair_int.int1.c b/Tests/SubDir/ThirdSubDir/pair_int.int1.c
new file mode 100644
index 0000000000..b7a6237818
--- /dev/null
+++ b/Tests/SubDir/ThirdSubDir/pair_int.int1.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void pair_stuff()
+{
+ printf("Placeholder for a strange file in subdirectory\n");
+}
diff --git a/Tests/SubDir/ThirdSubDir/pair_p_int.int1.c b/Tests/SubDir/ThirdSubDir/pair_p_int.int1.c
new file mode 100644
index 0000000000..95a66eee69
--- /dev/null
+++ b/Tests/SubDir/ThirdSubDir/pair_p_int.int1.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void pair_p_stuff()
+{
+ printf("Placeholder for another strange file in subdirectory\n");
+}
diff --git a/Tests/SubDir/ThirdSubDir/testfromauxsubdir.c b/Tests/SubDir/ThirdSubDir/testfromauxsubdir.c
new file mode 100644
index 0000000000..d1620845f1
--- /dev/null
+++ b/Tests/SubDir/ThirdSubDir/testfromauxsubdir.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+void secondone();
+void pair_stuff();
+void pair_p_stuff();
+void vcl_stuff();
+
+int main()
+{
+ printf("Hello from subdirectory\n");
+ secondone();
+ pair_stuff();
+ pair_p_stuff();
+ vcl_stuff();
+ return 0;
+}
diff --git a/Tests/SubDir/ThirdSubDir/thirdone.c b/Tests/SubDir/ThirdSubDir/thirdone.c
new file mode 100644
index 0000000000..3e9e5afe6b
--- /dev/null
+++ b/Tests/SubDir/ThirdSubDir/thirdone.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void secondone()
+{
+ printf("Hello again\n");
+}
diff --git a/Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c b/Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c
new file mode 100644
index 0000000000..a0c60f75aa
--- /dev/null
+++ b/Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void vcl_stuff()
+{
+ printf("Placeholder for a file with strange name\n");
+}
diff --git a/Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c b/Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c
new file mode 100644
index 0000000000..a0c60f75aa
--- /dev/null
+++ b/Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void vcl_stuff()
+{
+ printf("Placeholder for a file with strange name\n");
+}