@FeatureNewKwargs('dependency', '0.54.0', ['components'])
@FeatureNewKwargs('dependency', '0.52.0', ['include_type'])
@FeatureNewKwargs('dependency', '0.50.0', ['not_found_message', 'cmake_module_path', 'cmake_args'])
@FeatureNewKwargs('dependency', '0.49.0', ['disabler'])
@FeatureNewKwargs('dependency', '0.40.0', ['method'])
@FeatureNewKwargs('dependency', '0.38.0', ['default_options'])
@disablerIfNotFound
@permittedKwargs(permitted_kwargs['dependency'])
def func_dependency(self, node, args, kwargs):
    self.validate_arguments(args, 1, [str])
    name = args[0]
    display_name = (name if name else '(anonymous)')
    mods = extract_as_list(kwargs, 'modules')
    if mods:
        display_name += ' (modules: {})'.format(', '.join((str(i) for i in mods)))
    not_found_message = kwargs.get('not_found_message', '')
    if (not isinstance(not_found_message, str)):
        raise InvalidArguments('The not_found_message must be a string.')
    try:
        d = self.dependency_impl(name, display_name, kwargs)
    except Exception:
        if not_found_message:
            self.message_impl([not_found_message])
        raise
    if ((not d.found()) and not_found_message):
        self.message_impl([not_found_message])
        self.message_impl([not_found_message])
    if (name and d.found()):
        for_machine = self.machine_from_native_kwarg(kwargs)
        identifier = dependencies.get_dep_identifier(name, kwargs)
        if (identifier not in self.build.dependency_overrides[for_machine]):
            self.build.dependency_overrides[for_machine][identifier] = build.DependencyOverride(d.held_object, node, explicit=False)
    return d
@FeatureNewKwargs('dependency', '0.54.0', ['components'])
@FeatureNewKwargs('dependency', '0.52.0', ['include_type'])
@FeatureNewKwargs('dependency', '0.50.0', ['not_found_message', 'cmake_module_path', 'cmake_args'])
@FeatureNewKwargs('dependency', '0.49.0', ['disabler'])
@FeatureNewKwargs('dependency', '0.40.0', ['method'])
@FeatureNewKwargs('dependency', '0.38.0', ['default_options'])
@disablerIfNotFound
@permittedKwargs(permitted_kwargs['dependency'])
def func_dependency(self, node, args, kwargs):
    self.validate_arguments(args, 1, [str])
    name = args[0]
    display_name = (name if name else '(anonymous)')
    mods = extract_as_list(kwargs, 'modules')
    if mods:
        display_name += ' (modules: {})'.format(', '.join((str(i) for i in mods)))
    not_found_message = kwargs.get('not_found_message', )
    if (not isinstance(not_found_message, str)):
        raise InvalidArguments('The not_found_message must be a string.')
    try:
        d = self.dependency_impl(name, display_name, kwargs)
    except Exception:
        if not_found_message:
            self.message_impl([not_found_message])
        raise
    if ((not d.found()) and not_found_message):
        self.message_impl([not_found_message])
        self.message_impl([not_found_message])
    if (name and d.found()):
        for_machine = self.machine_from_native_kwarg(kwargs)
        identifier = dependencies.get_dep_identifier(name, kwargs)
        if (identifier not in self.build.dependency_overrides[for_machine]):
            self.build.dependency_overrides[for_machine][identifier] = build.DependencyOverride(d.held_object, node, explicit=False)
    return d