diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2020-03-03 10:50:15 -0500 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-03-08 13:48:27 +0200 |
commit | ecb076ba002afb6a6678983dd02ac53d9b751f12 (patch) | |
tree | 3a56cfbd3c949efc4cc9434a708772099c19bf7b /docs/markdown | |
parent | 18f5a197da982ec48473903c0e2defd2d7797eb2 (diff) | |
download | meson-ecb076ba002afb6a6678983dd02ac53d9b751f12.zip meson-ecb076ba002afb6a6678983dd02ac53d9b751f12.tar.gz meson-ecb076ba002afb6a6678983dd02ac53d9b751f12.tar.bz2 |
qt5: Add has_tools() method
Diffstat (limited to 'docs/markdown')
-rw-r--r-- | docs/markdown/Qt5-module.md | 22 | ||||
-rw-r--r-- | docs/markdown/snippets/qt_has_tools.md | 10 |
2 files changed, 32 insertions, 0 deletions
diff --git a/docs/markdown/Qt5-module.md b/docs/markdown/Qt5-module.md index 3a51954..f1c2f6c 100644 --- a/docs/markdown/Qt5-module.md +++ b/docs/markdown/Qt5-module.md @@ -23,6 +23,28 @@ This method generates the necessary targets to build translation files with lrel - `install_dir` directory to install to (optional). - `build_by_default` when set to true, to have this target be built by default, that is, when invoking plain ninja; the default value is false (optional). +## has_tools + +This method returns `true` if all tools used by this module are found, `false` +otherwise. + +It should be used to compile optional Qt code: +```meson +qt5 = import('qt5') +if qt5.has_tools(required: get_option('qt_feature')) + moc_files = qt5.preprocess(...) + ... +endif +``` + +This method takes the following keyword arguments: +- `required`: by default, `required` is set to `false`. If `required` is set to + `true` or an enabled [`feature`](Build-options.md#features) and some tools are + missing Meson will abort. +- `method`: method used to find the Qt dependency (`auto` by default). + +*Since: 0.54.0* + ## Dependencies See [Qt dependencies](Dependencies.md#qt4-qt5) diff --git a/docs/markdown/snippets/qt_has_tools.md b/docs/markdown/snippets/qt_has_tools.md new file mode 100644 index 0000000..3569ecb --- /dev/null +++ b/docs/markdown/snippets/qt_has_tools.md @@ -0,0 +1,10 @@ +## Added `has_tools` method to qt module + +It should be used to compile optional Qt code: +```meson +qt5 = import('qt5') +if qt5.has_tools(required: get_option('qt_feature')) + moc_files = qt5.preprocess(...) + ... +endif +``` |