summaryrefslogtreecommitdiff
path: root/doc/examples/out-of-source-build/files/OutOfSourceProject/main
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/out-of-source-build/files/OutOfSourceProject/main')
-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
2 files changed, 25 insertions, 0 deletions
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;
+}