@FeatureNewKwargs('dependency', '0.57.0', ['cmake_package_version'])
@FeatureNewKwargs('dependency', '0.56.0', ['allow_fallback'])
@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_dependency_kwargs)
@typed_pos_args('dependency', varargs=str, min_varargs=1)
def func_dependency(self, node, args, kwargs):
    names = [n for n in args[0] if n]
    if (len(names) > 1):
        FeatureNew('dependency with more than one name', '0.60.0').use(self.subproject)
    allow_fallback = kwargs.get('allow_fallback')
    if ((allow_fallback is not None) and (not isinstance(allow_fallback, bool))):
        raise InvalidArguments('"allow_fallback" argument must be boolean')
    fallback = kwargs.get('fallback')
    default_options = kwargs.get('default_options')
    df = DependencyFallbacksHolder(self, names, allow_fallback, default_options)
    df.set_fallback(fallback)
    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 = df.lookup(kwargs)
    except Exception:
        if not_found_message:
            self.message_impl([not_found_message])
        raise
    assert isinstance(d, Dependency)
    if ((not d.found()) and not_found_message):
        self.message_impl([not_found_message])
        self.message_impl([not_found_message])
    if ('include_type' in kwargs):
        wanted = kwargs['include_type']
        if (not isinstance(wanted, str)):
            raise InvalidArguments('The `include_type` kwarg must be a string')
        actual = d.get_include_type()
        if (wanted != actual):
            mlog.debug(f'Current include type of {args[0]} is {actual}. Converting to requested {wanted}')
            d = d.generate_system_dependency(wanted)
    if (d.feature_since is not None):
        (version, extra_msg) = d.feature_since
        FeatureNew.single_use(f'dep {d.name!r} custom lookup', version, self.subproject, extra_msg, node)
    for f in d.featurechecks:
        f.use(self.subproject, node)
    return d
@FeatureNewKwargs('dependency', '0.57.0', ['cmake_package_version'])
@FeatureNewKwargs('dependency', '0.56.0', ['allow_fallback'])
@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_dependency_kwargs)
@typed_pos_args('dependency', varargs=str, min_varargs=1)
def func_dependency(self, node, args, kwargs):
    names = [n for n in args[0] if n]
    if (len(names) > 1):
        FeatureNew('dependency with more than one name', '0.60.0').use(self.subproject)
    allow_fallback = kwargs.get('allow_fallback')
    if ((allow_fallback is not None) and (not isinstance(allow_fallback, bool))):
        raise InvalidArguments('"allow_fallback" argument must be boolean')
    fallback = kwargs.get('fallback')
    default_options = kwargs.get('default_options')
    df = DependencyFallbacksHolder(self, names, allow_fallback, default_options)
    df.set_fallback(fallback)
    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 = df.lookup(kwargs)
    except Exception:
        if not_found_message:
            self.message_impl([not_found_message])
        raise
    assert isinstance(d, Dependency)
    if ((not d.found()) and not_found_message):
        self.message_impl([not_found_message])
        self.message_impl([not_found_message])
    if ('include_type' in kwargs):
        wanted = kwargs['include_type']
        if (not isinstance(wanted, str)):
            raise InvalidArguments('The `include_type` kwarg must be a string')
        actual = d.get_include_type()
        if (wanted != actual):
            mlog.debug(f'Current include type of {args[0]} is {actual}. Converting to requested {wanted}')
            d = d.generate_system_dependency(wanted)
    if (d.feature_since is not None):
        (version, extra_msg) = d.feature_since
        FeatureNew.single_use(f'dep {d.name!r} custom lookup', version, self.subproject, extra_msg, node)
    for f in d.featurechecks:
        f.use(self.subproject, node)
    return d