# Make miss dependencies when add\_custom\_command depends on add\_custom\_target or add\_custom\_command

**URL:** https://discourse.cmake.org/t/make-miss-dependencies-when-add-custom-command-depends-on-add-custom-target-or-add-custom-command/835
**Category:** Code
**Tags:** gen:makefiles
**Created:** [March 21, 2020, 10:14am UTC](https://discourse.cmake.org/t/make-miss-dependencies-when-add-custom-command-depends-on-add-custom-target-or-add-custom-command/835 "2020-03-21T10:14:51Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![fdk17](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/f/ea666f/32.png) [@fdk17](https://discourse.cmake.org/u/fdk17)
#### Post date: [March 21, 2020, 11:34pm UTC](https://discourse.cmake.org/t/make-miss-dependencies-when-add-custom-command-depends-on-add-custom-target-or-add-custom-command/835/5 "2020-03-21T23:34:45Z")

</div>

I think you should be using ${TEST\_OUTPUT} as the dependency of test\_file2.txt. I don’t follow why you wouldn’t. By itself " `DEPENDS gen_test_file`" just means that a target dependency will be made. But the command itself isn’t dependent upon anything. It’ll just run the first time to create test\_file2.txt and once that’s done it’ll never run again. It probably should be "`DEPENDS gen_test_file ${TEST_OUTPUT}`. This creates the target dependency and then if ${TEST\_OUTPUT} changes it should run again.

It was recently stated again that “Custom targets don’t have outputs”. [unable to get target location](https://discourse.cmake.org/t/unable-to-get-target-location/797/2). The documentation confirms this “The target has no output file”. What is " `$<TARGET_PROPERTY:gen_test_file,GENERATED_FILE>` supposed to evaluate to? I couldn’t file that property listed in the documentation. What is it supposed to be copying? I understand that certain generators implement stamp files and such that seems to be an implementation detail and not a real “output” to be depended upon.

---

_[View the full topic](https://discourse.cmake.org/t/make-miss-dependencies-when-add-custom-command-depends-on-add-custom-target-or-add-custom-command/835)._
