# Set CPACK\_DEBIAN\_PACKAGE\_DEPENDS from subproject library

**URL:** https://discourse.cmake.org/t/set-cpack-debian-package-depends-from-subproject-library/1803
**Category:** Code
**Created:** [September 9, 2020, 11:19pm UTC](https://discourse.cmake.org/t/set-cpack-debian-package-depends-from-subproject-library/1803 "2020-09-09T23:19:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![DKLind](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dklind/32/526_2.png) [@DKLind](https://discourse.cmake.org/u/DKLind)
#### Post date: [September 9, 2020, 11:19pm UTC](https://discourse.cmake.org/t/set-cpack-debian-package-depends-from-subproject-library/1803/1 "2020-09-09T23:19:33Z")

</div>

I have a very large CMake project with lots of binary and library subprojects. I am using CPACK\_DEBIAN\_PACKAGE\_GENERATE\_SHLIBS to automatically set CPACK\_DEBIAN\_PACKAGE\_DEPENDS from external libraries for a target.  
Is there a way to set CPACK\_DEBIAN\_PACKAGE\_DEPENDS for a target automatically from subproject target libraries specified by target\_link\_libraries?

Target binA depends on target libB

Automatically add target libB to CPACK\_DEBIAN\_PACKAGE\_DEPENDS

EDIT: Never mind target\_link\_libraries. What I’m really trying to solve is this:

Target binA depends on target libB (which contains a shlibs file in it’s build directory). How do I get the shlibs file to be recognized by dpkg-shlibdeps?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [November 19, 2020, 1:17pm UTC](https://discourse.cmake.org/t/set-cpack-debian-package-depends-from-subproject-library/1803/2 "2020-11-19T13:17:51Z")

</div>

@kyle.edwards Not sure if you’ve done this before or not.
