https://github.com/friendlyanon/cmake-init-multi-target
https://github.com/friendlyanon/cmake-init-multi-target
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/friendlyanon/cmake-init-multi-target
- Owner: friendlyanon
- Created: 2021-09-23T10:47:34.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-10-12T14:48:30.000Z (over 4 years ago)
- Last Synced: 2025-09-08T22:52:03.647Z (10 months ago)
- Language: CMake
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# multi-target
This project is an example project generated with [cmake-init][1] with the
purpose of showing off how to create an internal dependency as an
implementation detail in the form of a static library.
# Building and installing
See the [BUILDING](BUILDING.md) document.
## Internal dependency
Right now, CMake does not combine the `.a` or `.lib` files, which means that if
your public static library target depends on one as an internal dependency, you
must also install the internal dependency, which will show up in the install
interface as a `$` generator expression. The purpose of this
genex is that the public static library target does not contain the object code
form the internal static library dependency, so it must also be linked into a
consuming final target. If CMake didn't do this for you, then you would end up
with linker errors due to missing symbols related to an implementation detail.
This list will assume that your public target is static or shared depending on
the value of CMake provided `BUILD_SHARED_LIBS`. Changes to be made:
* Make the [config file](cmake/install-config.cmake.in) configurable.
* Setup a [new export set](cmake/install-rules.cmake#L63) for the internal
dependency.
[1]: https://github.com/friendlyanon/cmake-init