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

<div class="post-metadata">

### Author: ![KUGA2](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kuga2/32/4968_2.png) [@KUGA2](https://discourse.cmake.org/u/KUGA2)
#### Post date: [March 23, 2020, 11:49am UTC](https://discourse.cmake.org/t/make-miss-dependencies-when-add-custom-command-depends-on-add-custom-target-or-add-custom-command/835/11 "2020-03-23T11:49:04Z")

</div>

this is probably the same than the `add_depenencies()` issue multiple users come across.  
(e.g. [How to create file-dependency for all sources of target?](https://discourse.cmake.org/t/how-to-create-file-dependency-for-all-sources-of-target/706))  
While this is documented, i think this is something that should be globally fixed maybe via a policy setting.  
IMO: When A depends on a target B, you always want both:

1. A is built after B
2. A needs rebuild if B needs rebuild.

---

_[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)._
