cmake: Make the CMake targte not found error more useful (see #7567)

pull/5405/merge
Daniel Mensinger 4 years ago committed by Jussi Pakkanen
parent 1ddd2b4cbe
commit 948741355f
  1. 4
      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(<cmake_subproject>.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']]))

Loading…
Cancel
Save