unable to get target location

A custom target has no build output, so there is nothing to get the location of. If tgt was a library or executable, it would work okay. That said, it would be rare to need the LOCATION target property. In the context of where you want to use it, if generator expressions are supported, the expression $<TARGET_FILE:tgt> is much more robust because it works for multi-config generators, whereas LOCATION doesn’t.

2 Likes