summaryrefslogtreecommitdiff
path: root/doc/examples/out-of-source-build/files/OutOfSourceProject
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/out-of-source-build/files/OutOfSourceProject')
-rw-r--r--doc/examples/out-of-source-build/files/OutOfSourceProject/CMakeLists.txt14
-rw-r--r--doc/examples/out-of-source-build/files/OutOfSourceProject/README5
-rw-r--r--doc/examples/out-of-source-build/files/OutOfSourceProject/main/CMakeLists.txt14
-rw-r--r--doc/examples/out-of-source-build/files/OutOfSourceProject/main/main.c11
4 files changed, 44 insertions, 0 deletions
diff --git a/doc/examples/out-of-source-build/files/OutOfSourceProject/CMakeLists.txt b/doc/examples/out-of-source-build/files/OutOfSourceProject/CMakeLists.txt
new file mode 100644
index 000000000..287c78371
--- /dev/null
+++ b/doc/examples/out-of-source-build/files/OutOfSourceProject/CMakeLists.txt
@@ -0,0 +1,14 @@
+
+# Set the minimum version of CMake that can be used
+# To find the cmake version run
+# $ cmake --version
+cmake_minimum_required(VERSION 2.8)
+
+# Set the project name
+project (hello_main C)
+
+# Set something so that we can see if main.c was compiled from this cmake
+# projcet
+set(CMAKE_C_FLAGS "-DFULL_PROJECT")
+
+add_subdirectory(main)
diff --git a/doc/examples/out-of-source-build/files/OutOfSourceProject/README b/doc/examples/out-of-source-build/files/OutOfSourceProject/README
new file mode 100644
index 000000000..49489374a
--- /dev/null
+++ b/doc/examples/out-of-source-build/files/OutOfSourceProject/README
@@ -0,0 +1,5 @@
+This is a simple example project for using buildstream to build software that is
+located in different parts of it sources
+
+The source code will produce different code depending on which directory you
+specify to cmake
diff --git a/doc/examples/out-of-source-build/files/OutOfSourceProject/main/CMakeLists.txt b/doc/examples/out-of-source-build/files/OutOfSourceProject/main/CMakeLists.txt
new file mode 100644
index 000000000..417693296
--- /dev/null
+++ b/doc/examples/out-of-source-build/files/OutOfSourceProject/main/CMakeLists.txt
@@ -0,0 +1,14 @@
+
+# Set the minimum version of CMake that can be used
+# To find the cmake version run
+# $ cmake --version
+cmake_minimum_required(VERSION 2.8)
+
+# Set the project name
+project (hello_buildstreams C)
+
+# Add an executable
+add_executable(hello_buildstream main.c)
+
+
+install(TARGETS hello_buildstream DESTINATION /bin)
diff --git a/doc/examples/out-of-source-build/files/OutOfSourceProject/main/main.c b/doc/examples/out-of-source-build/files/OutOfSourceProject/main/main.c
new file mode 100644
index 000000000..a114945e2
--- /dev/null
+++ b/doc/examples/out-of-source-build/files/OutOfSourceProject/main/main.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+int main()
+{
+ // printf() displays the string inside quotation
+#ifdef FULL_PROJECT
+ printf("Hello, World! Built from the source root.\n");
+#else
+ printf("Hello, World! Built from a subdirectory of the source.\n");
+#endif
+ return 0;
+}