[Qt module] Added lrelease detection

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>
pull/2676/head
Alexis Jeandet 7 years ago
parent 5de5e7673f
commit 1fd743e6ad
  1. 4
      mesonbuild/dependencies/ui.py
  2. 6
      mesonbuild/modules/qt.py

@ -207,13 +207,15 @@ class QtBaseDependency(ExternalDependency):
moc = ExternalProgram(os.path.join(self.bindir, 'moc'), silent=True)
uic = ExternalProgram(os.path.join(self.bindir, 'uic'), silent=True)
rcc = ExternalProgram(os.path.join(self.bindir, 'rcc'), silent=True)
lrelease = ExternalProgram(os.path.join(self.bindir, 'lrelease'), silent=True)
else:
# We don't accept unsuffixed 'moc', 'uic', and 'rcc' because they
# are sometimes older, or newer versions.
moc = ExternalProgram('moc-' + self.name, silent=True)
uic = ExternalProgram('uic-' + self.name, silent=True)
rcc = ExternalProgram('rcc-' + self.name, silent=True)
return moc, uic, rcc
lrelease = ExternalProgram('lrelease-' + self.name, silent=True)
return moc, uic, rcc, lrelease
def _pkgconfig_detect(self, mods, kwargs):
# We set the value of required to False so that we can try the

@ -43,13 +43,13 @@ class QtBaseModule:
kwargs = {'required': 'true', 'modules': 'Core', 'silent': 'true', 'method': method}
qt = _QT_DEPS_LUT[self.qt_version](env, kwargs)
# Get all tools and then make sure that they are the right version
self.moc, self.uic, self.rcc = qt.compilers_detect()
self.moc, self.uic, self.rcc, self.lrelease = qt.compilers_detect()
# Moc, uic and rcc write their version strings to stderr.
# Moc and rcc return a non-zero result when doing so.
# What kind of an idiot thought that was a good idea?
for compiler, compiler_name in ((self.moc, "Moc"), (self.uic, "Uic"), (self.rcc, "Rcc")):
for compiler, compiler_name in ((self.moc, "Moc"), (self.uic, "Uic"), (self.rcc, "Rcc"), (self.lrelease, "lrelease")):
if compiler.found():
stdout, stderr = Popen_safe(compiler.get_command() + ['-v'])[1:3]
stdout, stderr = Popen_safe(compiler.get_command() + ['-version'])[1:3]
stdout = stdout.strip()
stderr = stderr.strip()
if 'Qt {}'.format(self.qt_version) in stderr:

Loading…
Cancel
Save