# 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:** 6

<div class="post-metadata">

### Author: ![Angew](https://discourse.cmake.org/user_avatar/discourse.cmake.org/angew/32/229_2.png) [@Angew](https://discourse.cmake.org/u/Angew)
#### Post date: [March 13, 2020, 12:51pm UTC](https://discourse.cmake.org/t/unable-to-get-target-location/797/6 "2020-03-13T12:51:51Z")

</div>

Notice that even the documentation you quoted says “It was meant to get the location of an  
**executable** target’s output file” (emphasis mine). You have a _custom_ target, not an _executable_ target. Custom targets don’t have outputs, so they don’t have a location, and have never had one.

If your custom target produces something at a path on disk, you should use your knowledge of that path directly instead of trying to query it from the target. If that proves difficult due to scoping or knowledge-separation issues, you can set a custom property on the custom target which will store that path, and retrieve that property at the point you need to use it.

---

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