aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-03-20 00:15:01 +0200
committerGitHub <noreply@github.com>2018-03-20 00:15:01 +0200
commit657836b555ef03c1ad70a855498dee15da19c2dc (patch)
tree25402a1b78ac09e70d9994a930590d5274ad9655 /docs/markdown
parentd012b5b997e917a971bca1236a065453493c780d (diff)
parent5f81d362078ec1f1de97fc55cdbebb69d5e37865 (diff)
downloadmeson-657836b555ef03c1ad70a855498dee15da19c2dc.zip
meson-657836b555ef03c1ad70a855498dee15da19c2dc.tar.gz
meson-657836b555ef03c1ad70a855498dee15da19c2dc.tar.bz2
Merge pull request #3223 from sarum9in/rename
Add install_data() rename parameter
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Installing.md13
-rw-r--r--docs/markdown/Reference-manual.md7
-rw-r--r--docs/markdown/snippets/install_data-rename.md11
3 files changed, 31 insertions, 0 deletions
diff --git a/docs/markdown/Installing.md b/docs/markdown/Installing.md
index 4670544..b8e6a81 100644
--- a/docs/markdown/Installing.md
+++ b/docs/markdown/Installing.md
@@ -29,6 +29,19 @@ install_man('foo.1') # -> share/man/man1/foo.1.gz
install_data('datafile.dat', install_dir : join_paths(get_option('datadir'), 'progname')) # -> share/progname/datafile.dat
```
+`install_data()` supports rename of the file *since 0.46.0*.
+
+```meson
+# file.txt -> {datadir}/{projectname}/new-name.txt
+install_data('file.txt', rename : 'new-name.txt')
+
+# file1.txt -> share/myapp/dir1/data.txt
+# file2.txt -> share/myapp/dir2/data.txt
+install_data(['file1.txt', 'file2.txt'],
+ rename : ['dir1/data.txt', 'dir2/data.txt'],
+ install_dir : 'share/myapp')
+```
+
Sometimes you want to copy an entire subtree directly. For this use case there is the `install_subdir` command, which can be used like this.
```meson
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 589baf1..0d7dedc 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -737,6 +737,13 @@ arguments. The following keyword arguments are supported:
To leave any of these three as the default, specify `false`.
+- `rename` if specified renames each source file into corresponding file
+ from `rename` list. Nested paths are allowed and they are joined with
+ `install_dir`. Length of `rename` list must be equal to the number of sources.
+ *(added 0.46.0)*
+
+See [Installing](Installing.md) for more examples.
+
### install_headers()
``` meson
diff --git a/docs/markdown/snippets/install_data-rename.md b/docs/markdown/snippets/install_data-rename.md
new file mode 100644
index 0000000..6378d0f
--- /dev/null
+++ b/docs/markdown/snippets/install_data-rename.md
@@ -0,0 +1,11 @@
+## install_data() supports rename
+
+`rename` parameter is used to change names of the installed files.
+In order to install
+- `file1.txt` into `share/myapp/dir1/data.txt`
+- `file2.txt` into `share/myapp/dir2/data.txt`
+```meson
+install_data(['file1.txt', 'file2.txt'],
+ rename : ['dir1/data.txt', 'dir2/data.txt'],
+ install_dir : 'share/myapp')
+```