aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-11-08 23:45:31 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-11-11 01:51:02 +0530
commit3fe5fcd7f7ca7a6ba4d9b6235bf74304aeaa8d3d (patch)
treee57092427f6ec441de87a4a72785a4e0d0a63ed1
parente02aaad63286169aebf63109363fed648a185b05 (diff)
downloadmeson-3fe5fcd7f7ca7a6ba4d9b6235bf74304aeaa8d3d.zip
meson-3fe5fcd7f7ca7a6ba4d9b6235bf74304aeaa8d3d.tar.gz
meson-3fe5fcd7f7ca7a6ba4d9b6235bf74304aeaa8d3d.tar.bz2
qt4/qt5: Print a message when moc/uic/rcc aren't found
Without this a strange exception is spewed that no one would be able to understand. Finding each of those compilers isn't a problem unless sources are specified that require those compilers, so only error out in those cases. Closes #758
-rw-r--r--mesonbuild/modules/qt4.py8
-rw-r--r--mesonbuild/modules/qt5.py8
2 files changed, 16 insertions, 0 deletions
diff --git a/mesonbuild/modules/qt4.py b/mesonbuild/modules/qt4.py
index b1d951b..1c5a0d1 100644
--- a/mesonbuild/modules/qt4.py
+++ b/mesonbuild/modules/qt4.py
@@ -115,7 +115,13 @@ class Qt4Module():
if not isinstance(srctmp, list):
srctmp = [srctmp]
sources = args[1:] + srctmp
+ err_msg = "{0} sources specified and couldn't find {1}, " \
+ "please check your qt4 installation"
+ if len(moc_headers) + len(moc_sources) > 0 and not self.moc.found():
+ raise MesonException(err_msg.format('MOC', 'moc-qt4'))
if len(rcc_files) > 0:
+ if not self.rcc.found():
+ raise MesonException(err_msg.format('RCC', 'rcc-qt4'))
rcc_kwargs = {'output' : '@BASENAME@.cpp',
'arguments' : ['@INPUT@', '-o', '@OUTPUT@']}
rcc_gen = build.Generator([self.rcc], rcc_kwargs)
@@ -127,6 +133,8 @@ class Qt4Module():
[rcc_output.add_file(os.path.join(state.subdir, a)) for a in rcc_files]
sources.append(rcc_output)
if len(ui_files) > 0:
+ if not self.uic.found():
+ raise MesonException(err_msg.format('UIC', 'uic-qt4'))
ui_kwargs = {'output' : 'ui_@BASENAME@.h',
'arguments' : ['-o', '@OUTPUT@', '@INPUT@']}
ui_gen = build.Generator([self.uic], ui_kwargs)
diff --git a/mesonbuild/modules/qt5.py b/mesonbuild/modules/qt5.py
index 9fffcff..01e9df1 100644
--- a/mesonbuild/modules/qt5.py
+++ b/mesonbuild/modules/qt5.py
@@ -122,7 +122,13 @@ class Qt5Module():
if not isinstance(srctmp, list):
srctmp = [srctmp]
sources = args[1:] + srctmp
+ err_msg = "{0} sources specified and couldn't find {1}, " \
+ "please check your qt5 installation"
+ if len(moc_headers) + len(moc_sources) > 0 and not self.moc.found():
+ raise MesonException(err_msg.format('MOC', 'moc-qt5'))
if len(rcc_files) > 0:
+ if not self.rcc.found():
+ raise MesonException(err_msg.format('RCC', 'rcc-qt5'))
qrc_deps = []
for i in rcc_files:
qrc_deps += self.parse_qrc(state, i)
@@ -137,6 +143,8 @@ class Qt5Module():
rcc_kwargs)
sources.append(res_target)
if len(ui_files) > 0:
+ if not self.uic.found():
+ raise MesonException(err_msg.format('UIC', 'uic-qt5'))
ui_kwargs = {'output' : 'ui_@BASENAME@.h',
'arguments' : ['-o', '@OUTPUT@', '@INPUT@']}
ui_gen = build.Generator([self.uic], ui_kwargs)