[CMake] Multiple exports for a target installation

Craig Scott craig.scott at crascit.com
Sun Jun 16 01:43:25 EDT 2019


On Sat, Jun 15, 2019 at 9:03 PM Shoaib Meenai <smeenai at fb.com> wrote:

> Is it possible to associate a target with multiple exports? For example,
> if I'm building a project where I want to create multiple export sets, but
> there's some overlap in targets between those sets. I tried passing
> multiple EXPORT options to the install(TARGETS) signature but I just got an
> error: install TARGETS given unknown argument "EXPORT".
>

Typically, you'd want your export sets to not be overlapping and to contain
no cyclic dependencies. If you have a target in multiple export sets, it
suggests that you probably should factor out that target to a separate
export set that other exports then depend on. That said, if you have a
scenario that legitimately requires a target in multiple export sets, then
you would need to use multiple install() commands to achieve this,
specifying a different export set for each one.


-- 
Craig Scott
Melbourne, Australia
https://crascit.com

Get the hand-book for every CMake user: Professional CMake: A Practical
Guide <https://crascit.com/professional-cmake/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190615/244af691/attachment.html>


More information about the CMake mailing list