# unable to get target location

**URL:** https://discourse.cmake.org/t/unable-to-get-target-location/797
**Category:** Code
**Created:** [March 12, 2020, 12:51pm UTC](https://discourse.cmake.org/t/unable-to-get-target-location/797 "2020-03-12T12:51:19Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [March 12, 2020, 8:14pm UTC](https://discourse.cmake.org/t/unable-to-get-target-location/797/2 "2020-03-12T20:14:48Z")

</div>

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.

---

_[View the full topic](https://discourse.cmake.org/t/unable-to-get-target-location/797)._
