# Combining multiple static libraries onto one. How to retrieve list of static libraries from target?

**URL:** https://discourse.cmake.org/t/combining-multiple-static-libraries-onto-one-how-to-retrieve-list-of-static-libraries-from-target/5302
**Category:** Code
**Created:** [March 26, 2022, 3:44pm UTC](https://discourse.cmake.org/t/combining-multiple-static-libraries-onto-one-how-to-retrieve-list-of-static-libraries-from-target/5302 "2022-03-26T15:44:05Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [March 29, 2022, 1:24pm UTC](https://discourse.cmake.org/t/combining-multiple-static-libraries-onto-one-how-to-retrieve-list-of-static-libraries-from-target/5302/2 "2022-03-29T13:24:39Z")

</div>

This thread may be of interest:

> [@does POST\_BUILD work with add\_custom\_target and Visual Studio?](https://discourse.cmake.org/t/does-post-build-work-with-add-custom-target-and-visual-studio/5290):
>
> I build a static library and then want to add two more static libs to it after it is built. The documentation for add\_custom\_command/“BUILD EVENTS” says The command becomes part of the target and will only execute when the target itself is built. If the target is already built, the command will not execute. I have a command like add\_custom\_command( TARGET something POST\_BUILD COMMAND lib $\<TARGET\_FILE:something\> $\<TARGET\_FILE:extraLib\> $\<TARGET\_FILE:anotherLib\> ) However, in pra…

---

_[View the full topic](https://discourse.cmake.org/t/combining-multiple-static-libraries-onto-one-how-to-retrieve-list-of-static-libraries-from-target/5302)._
