diff options
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 +``` |