diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index ca98b1c58..238375302 100644 --- a/mesonbuild/modules/cmake.py +++ b/mesonbuild/modules/cmake.py @@ -92,7 +92,9 @@ class CMakeSubprojectHolder(InterpreterObject, ObjectHolder): tgt = args[0] res = self.held_object.cm_interpreter.target_info(tgt) if res is None: - raise InterpreterException('The CMake target {} does not exist'.format(tgt)) + raise InterpreterException('The CMake target {} does not exist\n'.format(tgt) + + ' Use the following command in your meson.build to list all available targets:\n\n' + + ' message(\'CMaket targets:\\n - \' + \'\\n - \'.join(.target_list()))') # Make sure that all keys are present (if not this is a bug) assert(all([x in res for x in ['inc', 'src', 'dep', 'tgt', 'func']]))