"::@<address>" as suffix of returned item of LINK_LIBRARIES

I’m calling get_target_property for LINK_LIBRARIES on targets that I want to enumerate dependencies of.

I noticed that sometimes I’m returned strings like this:
and other times (the norm) I’m returned strings like this:

Ultimately, I want to test each of these returned items against if(TARGET ${item}) and act on those that are targets of my own creation (rather than say, external libraries). But unless I strip off the ::@<0000016D82804B50> suffix, MyTargetA (as example from above) will go unnoticed as a target. Just curious what these variations represent.


This is related to modifying or updating targets from outside the directory they are declared in. It is mentioned in the docs for LINK_LIBRARIES. You’ll need to strip them off, though your if (TARGET) might fail for scoped imported targets (which I guess is fine for your use case).

Thanks! I even searched CMake docs for “::@”, but no hits.
Yeah, I’m stripping off the suffix and everything else works fine… just missed finding this in the docs.

Yeah, unfortunately, searching for (just) symbols isn’t likely to work well. I think the search index is just based on “words” rather than a full text database, but that’s more of a Sphinx thing than CMake anyways.