summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-12-17 03:28:15 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2016-12-18 20:00:25 +0200
commit6b8df9da84fe5c8aef92230a59ac22b99d548b00 (patch)
tree2a40fc1394cbf3e9afe9b151073b3f2092c64efd /test cases
parent411e88a5ab06dfdc6817c03f7dc96defc3a5d6aa (diff)
downloadmeson-6b8df9da84fe5c8aef92230a59ac22b99d548b00.tar.gz
custom_target: Make directory outputs installable
This is useful in many cases where the list of files cannot be known in advance and is just dumped inside a directory. For example when generating documentation with doxygen and other tools that we don't have built-in support for. Includes a test for the same. Closes #893
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/131 custom target directory install/docgen.py12
-rw-r--r--test cases/common/131 custom target directory install/installed_files.txt3
-rw-r--r--test cases/common/131 custom target directory install/meson.build9
3 files changed, 24 insertions, 0 deletions
diff --git a/test cases/common/131 custom target directory install/docgen.py b/test cases/common/131 custom target directory install/docgen.py
new file mode 100644
index 000000000..245f37035
--- /dev/null
+++ b/test cases/common/131 custom target directory install/docgen.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+
+out = sys.argv[1]
+
+os.mkdir(out)
+
+for name in ('a', 'b', 'c'):
+ with open(os.path.join(out, name + '.html'), 'w') as f:
+ f.write(name)
diff --git a/test cases/common/131 custom target directory install/installed_files.txt b/test cases/common/131 custom target directory install/installed_files.txt
new file mode 100644
index 000000000..bcf20e0ac
--- /dev/null
+++ b/test cases/common/131 custom target directory install/installed_files.txt
@@ -0,0 +1,3 @@
+usr/share/doc/testpkgname/html/a.html
+usr/share/doc/testpkgname/html/b.html
+usr/share/doc/testpkgname/html/c.html
diff --git a/test cases/common/131 custom target directory install/meson.build b/test cases/common/131 custom target directory install/meson.build
new file mode 100644
index 000000000..ada9ae119
--- /dev/null
+++ b/test cases/common/131 custom target directory install/meson.build
@@ -0,0 +1,9 @@
+project('custom-target-dir-install', 'c')
+
+docgen = find_program('docgen.py')
+
+custom_target('docgen',
+ output : 'html',
+ command : [docgen, '@OUTPUT@'],
+ install : true,
+ install_dir : join_paths(get_option('datadir'), 'doc/testpkgname'))