Qt-Module: fix name option with multiple rcc files

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
pull/2579/head
Markus Theil 7 years ago
parent b36475ff44
commit 3f8a082a68
  1. 24
      mesonbuild/modules/qt.py

@ -101,17 +101,25 @@ class QtBaseModule:
qrc_deps = [] qrc_deps = []
for i in rcc_files: for i in rcc_files:
qrc_deps += self.parse_qrc(state, i) qrc_deps += self.parse_qrc(state, i)
# custom output name set? -> one output file, multiple otherwise
if len(args) > 0: if len(args) > 0:
name = args[0] name = args[0]
rcc_kwargs = {'input': rcc_files,
'output': name + '.cpp',
'command': [self.rcc, '-name', name, '-o', '@OUTPUT@', '@INPUT@'],
'depend_files': qrc_deps}
res_target = build.CustomTarget(name, state.subdir, state.subproject, rcc_kwargs)
sources.append(res_target)
else: else:
basename = os.path.split(rcc_files[0])[1] for rcc_file in rcc_files:
name = 'qt' + str(self.qt_version) + '-' + basename.replace('.', '_') basename = os.path.split(rcc_file)[1]
rcc_kwargs = {'input': rcc_files, name = 'qt' + str(self.qt_version) + '-' + basename.replace('.', '_')
'output': name + '.cpp', rcc_kwargs = {'input': rcc_file,
'command': [self.rcc, '-name', '@BASENAME@', '-o', '@OUTPUT@', '@INPUT@'], 'output': name + '.cpp',
'depend_files': qrc_deps} 'command': [self.rcc, '-name', '@BASENAME@', '-o', '@OUTPUT@', '@INPUT@'],
res_target = build.CustomTarget(name, state.subdir, state.subproject, rcc_kwargs) 'depend_files': qrc_deps}
sources.append(res_target) res_target = build.CustomTarget(name, state.subdir, state.subproject, rcc_kwargs)
sources.append(res_target)
if len(ui_files) > 0: if len(ui_files) > 0:
if not self.uic.found(): if not self.uic.found():
raise MesonException(err_msg.format('UIC', 'uic-qt' + self.qt_version)) raise MesonException(err_msg.format('UIC', 'uic-qt' + self.qt_version))

Loading…
Cancel
Save