cmTarget: Add cmLinkItem to refer to a target by name and pointer

Many items named in target_link_libraries calls are targets, but not
all.  Create a cmLinkItem type that acts like std::string so it can name
an item but also has a pointer to a cmTarget that is the result of
looking up the item name in the referencing target's scope.  This will
be useful to avoid duplicate lookup operations later.
This commit is contained in:
Brad King 2014-06-16 10:55:33 -04:00
parent a272344228
commit 4dad5fd20b
1 changed files with 12 additions and 0 deletions

View File

@ -43,6 +43,18 @@ class cmTarget;
class cmGeneratorTarget;
class cmTargetTraceDependencies;
// Basic information about each link item.
class cmLinkItem: public std::string
{
typedef std::string std_string;
public:
cmLinkItem(): std_string(), Target(0) {}
cmLinkItem(const std_string& n,
cmTarget const* t): std_string(n), Target(t) {}
cmLinkItem(cmLinkItem const& r): std_string(r), Target(r.Target) {}
cmTarget const* Target;
};
struct cmTargetLinkInformationMap:
public std::map<std::string, cmComputeLinkInformation*>
{