# boost consumption, its internal dependencies

**URL:** <https://discourse.cmake.org/t/boost-consumption-its-internal-dependencies/579>\
**Category:** Code\
**Created:** [February 4, 2020, 7:08pm UTC](https://discourse.cmake.org/t/boost-consumption-its-internal-dependencies/579 "2020-02-04T19:08:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lieven](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/l/c37758/32.png) [@Lieven](https://discourse.cmake.org/u/Lieven)\
**Post date:** [February 4, 2020, 7:08pm UTC](https://discourse.cmake.org/t/boost-consumption-its-internal-dependencies/579/1 "2020-02-04T19:08:24Z")

</div>

Use case : incorporating building some boost libraries via External Project, so no find\_package (since also cross build scenarios), Afterwards in the same CMakeLists.txt I can either turn them into:

1. imported targets ==\> doesn’t work since they are not build yet, and consumer CMakeLists.txt give warnings
2. turn them into interface libraries =\> this works fine, except for one problem. I am doing something similar like FindBoost.cmake, that is i also try to model the interdependencies, eg boost::thread depends on boost::chronoe,date\_time,atomic and for example boost::iostreams on zip (build with zip). Off course the only way to specify are INTERFACE specification, which means telling the user of the boost library in case to also link with the dependencies (my use case : all static libraries). So far so good, however the linker sometimes has issues, because the order itself is not correct, it is not taking into account that boost::thread depends on the other ones, and as such should come first to the linker command before its dependencies(similar for the iostreams versus zip).

How can this be done correctly ?

---

<div class="post-metadata">

**Author:** ![Lieven](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/l/c37758/32.png) [@Lieven](https://discourse.cmake.org/u/Lieven)\
**Post date:** [February 4, 2020, 7:10pm UTC](https://discourse.cmake.org/t/boost-consumption-its-internal-dependencies/579/2 "2020-02-04T19:10:30Z")

</div>

to be clear the super workspace pattern is something not to be used, it would complicate the entire setup drastically, so also not find\_package is considered ok.

---

<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:** [February 16, 2020, 12:40am UTC](https://discourse.cmake.org/t/boost-consumption-its-internal-dependencies/579/3 "2020-02-16T00:40:58Z")

</div>

> [@Lieven](#):
>
> to be clear the super workspace pattern is something not to be used

While I understand not wanting to do that, it sounds like `FetchContent` is the better solution for you then. Using `ExternalProject` to build dependencies you want to use `find_package` for as well isn’t really going to work out very often.
