summaryrefslogtreecommitdiff
path: root/odb-examples/qt/buildfile
diff options
context:
space:
mode:
Diffstat (limited to 'odb-examples/qt/buildfile')
-rw-r--r--odb-examples/qt/buildfile55
1 files changed, 55 insertions, 0 deletions
diff --git a/odb-examples/qt/buildfile b/odb-examples/qt/buildfile
new file mode 100644
index 0000000..49085ec
--- /dev/null
+++ b/odb-examples/qt/buildfile
@@ -0,0 +1,55 @@
+# file : qt/buildfile
+# license : GNU GPL v2; see accompanying LICENSE file
+
+if ($build.meta_operation != 'dist')
+{
+ assert ($qt) \
+ "Qt version should be configured for this example via config.odb_examples.qt variable"
+}
+
+import meta_libs = libodb%lib{odb}
+import meta_libs += libodb-qt%lib{odb-qt}
+import meta_libs += "libQt$(qt_ver)Core"%lib{"Qt$(qt_ver)Core"}
+
+import libs = libodb-$database%lib{odb-$database}
+
+exe{driver}: {hxx cxx}{* -employee-odb} {hxx ixx cxx}{employee-odb} testscript
+
+# The metadata library target which we use to extract the poptions variable
+# value for specifying the preprocessor options (-I, etc) on the ODB compiler
+# command line.
+#
+libue{employee-meta}: $meta_libs
+
+exe{driver}: libue{employee-meta} $libs
+
+<{hxx ixx cxx}{employee-odb}>: hxx{employee} libue{employee-meta} $odb
+{{
+ pops = $cxx.lib_poptions($<[1])
+ depdb hash $pops
+
+ depdb dyndep --dyn-target --target-what 'generated schema' --format lines \
+ -- echo ($sqlite ? '' : "$out_base/employee.sql")
+
+ $odb --std ($qt_ver == 5 ? c++11 : c++17) \
+ --database $database \
+ --profile qt \
+ --generate-schema \
+ --generate-query \
+ --generate-session \
+ --output-dir $out_base \
+ --table-prefix qt_ \
+ "-I$src_base" $pops \
+ $path($<[0])
+}}
+
+cxx.poptions =+ "-I$out_base" "-I$src_base" -DDATABASE_$ucase($database)
+
+# Testscript's run-time prerequisites.
+#
+# @@ BUILD2: Eventually we should be able to mark it as test.input once
+# this is supported for testscript tests.
+#
+exe{driver}: ../alias{database-client}: include = adhoc
+
+testscript@./: schema = employee