https://github.com/friendlyanon/cmake-init-transitive
https://github.com/friendlyanon/cmake-init-transitive
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/friendlyanon/cmake-init-transitive
- Owner: friendlyanon
- Created: 2021-12-09T16:19:22.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-12T23:00:48.000Z (over 3 years ago)
- Last Synced: 2025-03-11T08:12:52.602Z (10 months ago)
- Language: CMake
- Size: 8.79 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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