aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/qt.py
AgeCommit message (Collapse)AuthorFilesLines
2021-05-12gnome: Fix gtkdoc generationXavier Claessens1-2/+2
install_scripts used to replace @BUILD_ROOT@ and @SOURCE_ROOT@ but it was not documented and got removed in Meson 0.58.0. gnome.gtkdoc() was relying on that behaviour, but it has always been broken in the case the source or build directory contains spaces. Fix this by changing get_include_args() to substitue paths directly which will then get escaped correctly. Add a unit test that builds GObject documentation which is where this issue has been spotted. Fixes: #8744
2021-05-08Fix python exception thrown for invalid resource pathNellie Zhang1-1/+1
If an invalid resource path is specified, then an uncaught python exception occurs, and a backtrace is shown. Throw a MesonException instead to produce a cleaner error message.
2021-03-23Refactor Qt Dependency into proper split classes with factoriesDylan Baker1-13/+9
Currently the Qt Dependencies still use the old "combined" method for dependencies with multiple ways to be found. This is problematic as it means that `get_variable()` and friends don't work, as the dependency can't implement any of those methods. The correct solution is to make use of multiple Dependency instances, and a factory to tie them together. This does that. To handle QMake, I've leveraged the existing config-tool mechanism, which allows us to save a good deal of code, and use well tested code instead of rolling more of our own code. The one thing this doesn't do, but we probably should, is expose the macOS ExtraFrameworks directly, instead of forcing them to be found through QMake. That is a problem for another series, and someone who cares more about macOS than I do.
2021-03-22qt: move compilers_detect to the qt moduleDylan Baker1-2/+59
It's a method on the QtDependeny that exists purely for the consumption of the qt module (in the form, return some stuff the module makes into an instance variable). So put it where it actually belongs, and pass the qt dependency into it.
2021-03-19split program related classes and functions out of dependenciesDylan Baker1-1/+2
Dependencies is already a large and complicated package without adding programs to the list. This also allows us to untangle a bit of spaghetti that we have.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-10/+10
performed by running "pyupgrade --py36-plus" and committing the results
2021-02-07Add Qt6 moduleLuca Weiss1-2/+3
2020-11-04qt module: fix error message typo, translation qresource accepts qm not tsEli Schwartz1-1/+1
Fixes #7925
2020-09-22pylint: turn on bad-indentation errorDylan Baker1-23/+23
and fix all of the bad indentation
2020-08-25qt module: add qresource support to compile_translationsEli Schwartz1-11/+49
A common pattern in Qt5 applications is to embed translations in the executable using the qresource system. In this case, the list of translation files is already available in the .qrc file and there's no good reason to duplicate this info in meson.build. Let compile_translations optionally take a qrc input, in which case it will go straight to generating the relevant translations and rcc-generated .cpp, and directly return the thing users actually care about -- the .cpp for linking.
2020-07-13qt module: rcc supports depfiles now, given a recent enough version of Qt5Eli Schwartz1-1/+10
Add depfile support to generated targets for Qt >= 5.14. Move warning into the module init itself, to check if the version is too old before issuing. Also tweak the wording itself, to advise upgrading to a suitable version of Qt5 instead of advising to wait for a Qt bug to be fixed.
2020-07-04qt: Fix has_tools() when required=FalseXavier Claessens1-36/+15
Improve logs by making it clear when the program is found but has wrong version.
2020-03-08Merge pull request #6736 from dcbaker/mesonlib-type-annotationsJussi Pakkanen1-6/+4
Mesonlib type annotations
2020-03-08qt5: Add has_tools() methodXavier Claessens1-1/+20
2020-03-05Make use of unholderDylan Baker1-4/+2
We have a lot of cases of code like: ```python if hasattr(var, 'held_object'): var = var.held_object` ``` replace that with the unholder function.
2020-03-05remove ability to pass multiple keys to extract_as_listDylan Baker1-2/+2
This makes the typing annotations basically impossible to get right, but if we only have one key then it's easy. Fortunately python provides comprehensions, so we don't even need the ability to pass multiple keys, we can just [extract_as_list(kwargs, c) for c in ('a', 'b', 'c')] and get the same result.
2019-11-27modules/qt.py: friendlier "lrelease-qtN not found" error messageMarc Herbert1-0/+3
When lrelease-qtN is missing, upgrade the error message from the cryptic: meson.build:75:4: ERROR: Tried to use not-found external program in "command" to the meaningful: meson.build:75:4: ERROR: qt.compile_translations: lrelease-qt5 not found Issue found and tested with "test cases/frameworks/4 qt/"
2019-04-25Don't use len() to test for container emptinessDylan Baker1-6/+6
I ran the numbers once before (it's in the meson history) but it's *much* faster to *not* use len for testing if a container is empty or not.
2019-03-17Add feature warning for qt.compile_translationsLuca Weiss1-2/+2
2018-11-19lgtm: Too few arguments for string format.Jon Turney1-1/+1
Too few arguments for string format. Format "{0} sources specified and couldn't find {1}, please check your qt{2} installation" requires at least 3, but 2 are provided. This alert was introduced in f7f439c a year ago
2018-11-14dependencies/ui: Allow qt compilers and qmake to be specified in native fileDylan Baker1-4/+5
2018-10-24module-qt: add rcc_extra_arguments to pass extra arguments to rcc (#4406)xiannox1-5/+6
2018-09-28 Add support for uic_extra_arguments to qt5 (#4178)Salamandar1-4/+6
2018-09-03Qt: Allow passing dependency objects to preprocess method (#3470, #3875)Alexey Rochev1-6/+19
2018-06-01Add 0.44.0 featuresSalamandar1-0/+1
2018-06-01Add 0.40.0 featuresSalamandar1-1/+2
2018-04-04[Qt module] refactor b4cd949c48ab67891e4bc6b14a8f9f247e28777dAlexis Jeandet1-3/+5
Since relative path in qrc files are always relative to qrc file itself then we just need to check that normpath(qrc file + resource) doesn't start with build dir path, this would mean that the resource is generated. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2018-04-04[Qt module] More qrc fixesAlexis Jeandet1-8/+10
When several qrc files are given all qrc files dependencies were mixed. Fixed non working use case: When user try to guess build dir layout and add use a relative path between a generated qrc file and a generated resource. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2018-03-30[Qt module] Added generated resource test case + some fixesAlexis Jeandet1-4/+4
Subdir is already in generated resource path. Some PEP8 fixes. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2018-03-30[Qt module] add some logic to detect if resources are in build dirAlexis Jeandet1-1/+21
In order to handle generated resources embedded in qrc file, we need to be able to detect if files pointed from qrc are in build directory or not. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2018-03-26[Qt module] Add File object support for generated or not qrc filesAlexis Jeandet1-6/+14
Added missing sub-folder test Closes #3324 Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2018-01-30Use os.path: basename() and dirname() instead of split()Aleksey Filippov1-2/+2
According to Python documentation[1] dirname and basename are defined as follows: os.path.dirname() = os.path.split()[0] os.path.basename() = os.path.split()[1] For the purpose of better readability split() is replaced by appropriate function if only one part of returned tuple is used. [1]: https://docs.python.org/3/library/os.path.html#os.path.split
2018-01-20Fixed bugAlexis Jeandet1-1/+1
Adding the current subdir when extracting resources deps wasn't good, it is CustomTarget job to handle that. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-11-28[Qt module] Added workaround for qt tools version detectionAlexis Jeandet1-1/+5
Depending on the tool (moc, uic, rcc, lrelease), the Qt version (4.8, 5.7, 5.9) and the distribution (Fedora, debian,...) it seems you cannot predict which of -v or -version will be supported. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-11-23[Qt module] Added translation files compilation methodAlexis Jeandet1-0/+18
- Added a new compile_translations method since preprocess was already quite full and translations compilation is quite different from ui, qrc, cpp files preprocessing. - Updated translation. - Updated test case. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-11-22[Qt module] Added lrelease detectionAlexis Jeandet1-3/+3
Just detect lrelease as done with other Qt tools. Uses -version instead of -v to probe version since lrelease don't support it. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-11-22[Qt module] Few minor fixesAlexis Jeandet1-2/+2
- removed a typo in tools detection loop - added include dir also when parsing cpp sources with moc, not only headers Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-11-08Qt-Module: fix name option with multiple rcc filesMarkus Theil1-8/+16
Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
2017-11-03Qt-Module: fix rcc `name` with Qt4Markus Theil1-1/+1
Qt5's rcc knows --name and -name, Qt4's only -name. Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
2017-11-03Qt5-Module: add `name` option to rccMarkus Theil1-1/+1
This patch sets the --name option for files processed with rcc. It generates an additional initialization function, which can be used with static linking. Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
2017-10-31namespace run_targets by subprojectMartin Kelly1-1/+1
Currently, run_target does not get namespaced for each subproject, unlike executable and others. This means that two subprojects sharing the same run_target name cause meson to crash. Fix this by moving the subproject namespacing logic from the BuildTarget class to the Target class.
2017-10-29Fixes the `kwargs` handling.Leif Middelschulte1-1/+1
As suggested by @jeandet. Details: https://github.com/mesonbuild/meson/pull/2529#pullrequestreview-72703268
2017-10-26removes unnecessary code as suggested by @jeandetLeif Middelschulte1-5/+1
Details: https://github.com/mesonbuild/meson/pull/2529#discussion_r146985692
2017-10-26removes unnecessary if/else-statement as suggested by @jeandetLeif Middelschulte1-4/+1
Details: https://github.com/mesonbuild/meson/pull/2529#discussion_r146985692
2017-10-25Qt5-Module: Add `moc_extra_arguments` keyword support.Leif Middelschulte1-5/+14
This commit adds support for an additional `moc_extra_arguments` keyword. It becomes especially handy, when `moc`-ed sources conditionally provide `slots`, depending on compile time macros (i.e. defines).
2017-10-12Factorized Qt compilers version probing.Alexis Jeandet1-44/+17
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-10-10Factorized Qt4 and Qt5 modules in one base class.Alexis Jeandet1-0/+163
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>