An open API service indexing awesome lists of open source software.

https://github.com/friendlyanon/cmake-init-transitive


https://github.com/friendlyanon/cmake-init-transitive

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

          

# transitive

This project was generated by [cmake-init][1].
It's heavily stripped down to focus on showing how to propagate transitive
dependencies.

# Other examples

This example is similar to [cmake-init-multi-target][2], because this library
can be built as a static library, in which case private dependencies will show
up in your public link dependencies as `$` generator expressions
and similar to [cmake-init-use-pkg-config][3], because you have to modify the
installed config file to propagate dependencies.

# Steps to take

* [Link to the dependencies](CMakeLists.txt#L62) according to your requirements
(`PRIVATE` is *build* requirement, `INTERFACE` is *usage* requirement,
`PUBLIC` is both)
* Make the [install config](cmake/install-config.cmake) enumerate the packages
from above, but using [`find_dependency`][4] instead

Enumerating the dependencies is necessary even if the dependency is otherwise
an internal implementation detail and is not otherwise exposed in the library
interface.

[1]: https://github.com/friendlyanon/cmake-init
[2]: https://github.com/friendlyanon/cmake-init-multi-target
[3]: https://github.com/friendlyanon/cmake-init-use-pkg-config
[4]: https://cmake.org/cmake/help/latest/module/CMakeFindDependencyMacro.html