aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2015-01-07 09:23:52 +0100
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2015-01-07 13:48:15 +0100
commitdf2d99bf2b6317e6cf1ebf4422b6e93e20754751 (patch)
tree45e66e4460073031df8c08f2b518fd6d9b6b76f6 /examples
parent8c25d47a3e07c939ea5da0ab65c797ba14b94e21 (diff)
Improve the "app and lib" example.
Make it more realistic by giving the library a header file, so the example can demonstrate how to export an include path. Change-Id: I4b55af8b86ef4fa0cddc3f29cefc5054e82c88cf Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/app-and-lib/app/main.cpp3
-rw-r--r--examples/app-and-lib/lib/lib.h6
-rw-r--r--examples/app-and-lib/lib/lib.qbs10
3 files changed, 16 insertions, 3 deletions
diff --git a/examples/app-and-lib/app/main.cpp b/examples/app-and-lib/app/main.cpp
index 64fb7b7fb..eab054e8e 100644
--- a/examples/app-and-lib/app/main.cpp
+++ b/examples/app-and-lib/app/main.cpp
@@ -28,9 +28,8 @@
**
****************************************************************************/
-#include <stdio.h>
+#include <lib.h>
-int bla();
int main()
{
return bla();
diff --git a/examples/app-and-lib/lib/lib.h b/examples/app-and-lib/lib/lib.h
new file mode 100644
index 000000000..e6279fd33
--- /dev/null
+++ b/examples/app-and-lib/lib/lib.h
@@ -0,0 +1,6 @@
+#ifndef LIB_H
+#define LIB_H
+
+int bla();
+
+#endif // LIB_H
diff --git a/examples/app-and-lib/lib/lib.qbs b/examples/app-and-lib/lib/lib.qbs
index 5c1b7c170..da03a8fe9 100644
--- a/examples/app-and-lib/lib/lib.qbs
+++ b/examples/app-and-lib/lib/lib.qbs
@@ -40,8 +40,16 @@ import qbs 1.0
Product {
type: "staticlibrary"
name: "app-and-lib-lib"
- files: [ "lib.cpp" ]
+ files: [
+ "lib.cpp",
+ "lib.h",
+ ]
cpp.defines: ['CRUCIAL_DEFINE']
Depends { name: 'cpp' }
+
+ Export {
+ Depends { name: "cpp" }
+ cpp.includePaths: [path]
+ }
}