Constructs targets that are created after consuming 'sources'.
            The result will be the list of virtual-target, which the same length
            as 'target_types' attribute and with corresponding types.

            When 'name' is empty, all source targets must have the same value of
            the 'name' attribute, which will be used instead of the 'name' argument.

            The value of 'name' attribute for each generated target will be equal to
            the 'name' parameter if there's no name pattern for this type. Otherwise,
            the '%' symbol in the name pattern will be replaced with the 'name' parameter
            to obtain the 'name' attribute.

            For example, if targets types are T1 and T2(with name pattern "%_x"), suffixes
            for T1 and T2 are .t1 and t2, and source if foo.z, then created files would
            be "foo.t1" and "foo_x.t2". The 'name' attribute actually determined the
            basename of a file.

            Note that this pattern mechanism has nothing to do with implicit patterns
            in make. It's a way to produce target which name is different for name of
            source.

def generated_targets (self, sources, prop_set, project, name):
        """ Constructs targets that are created after consuming 'sources'.
            The result will be the list of virtual-target, which the same length
            as 'target_types' attribute and with corresponding types.

            When 'name' is empty, all source targets must have the same value of
            the 'name' attribute, which will be used instead of the 'name' argument.

            The value of 'name' attribute for each generated target will be equal to
            the 'name' parameter if there's no name pattern for this type. Otherwise,
            the '%' symbol in the name pattern will be replaced with the 'name' parameter
            to obtain the 'name' attribute.

            For example, if targets types are T1 and T2(with name pattern "%_x"), suffixes
            for T1 and T2 are .t1 and t2, and source if foo.z, then created files would
            be "foo.t1" and "foo_x.t2". The 'name' attribute actually determined the
            basename of a file.

            Note that this pattern mechanism has nothing to do with implicit patterns
            in make. It's a way to produce target which name is different for name of
            source.
        """
        if __debug__:
            from .targets import ProjectTarget
            assert is_iterable_typed(sources, virtual_target.VirtualTarget)
            assert isinstance(prop_set, property_set.PropertySet)
            assert isinstance(project, ProjectTarget)
            assert isinstance(name, basestring) or name is None
        if not name:
            name = self.determine_output_name(sources)

        # Assign an action for each target
        action = self.action_class()
        a = action(project.manager(), sources, self.id_, prop_set)

        # Create generated target for each target type.
        targets = []
        pre = self.name_prefix_
        post = self.name_postfix_
        for t in self.target_types_:
            basename = os.path.basename(name)
            generated_name = pre[0] + basename + post[0]
            generated_name = os.path.join(os.path.dirname(name), generated_name)
            pre = pre[1:]
            post = post[1:]

            targets.append(virtual_target.FileTarget(generated_name, t, project, a))

        return [ project.manager().virtual_targets().register(t) for t in targets ]