[CMake] Multiple exports for a target installation

Shoaib Meenai smeenai at fb.com
Mon Jun 17 20:29:26 EDT 2019


Thank you!

When you say having an export set that the other exports then depend on, do you mean the COMPONENT option of the install(EXPORT) signature, or something else? (Sadly the project I’m working with is still on CMake 3.4.3, whose documentation says something very different for the COMPONENT option than the latest version, but I’ll cross that bridge when I get to it.)

From: Craig Scott <craig.scott at crascit.com>
Date: Saturday, June 15, 2019 at 10:43 PM
To: Shoaib Meenai <smeenai at fb.com>
Cc: "cmake at cmake.org" <cmake at cmake.org>
Subject: Re: [CMake] Multiple exports for a target installation



On Sat, Jun 15, 2019 at 9:03 PM Shoaib Meenai <smeenai at fb.com<mailto: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<https://urldefense.proofpoint.com/v2/url?u=https-3A__crascit.com&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=on4z0WGnwFnkVmDOCqIFdWlFaYpovsd4phHIcUgPrpk&s=xtBD4V4zZnM8lf5f41WOQ8MblhgMCye_s3uF7xbq_Hc&e=>

Get the hand-book for every CMake user: Professional CMake: A Practical Guide<https://urldefense.proofpoint.com/v2/url?u=https-3A__crascit.com_professional-2Dcmake_&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=on4z0WGnwFnkVmDOCqIFdWlFaYpovsd4phHIcUgPrpk&s=_55JCkwuEWq36iPA22_aJhSbndgvG-h07aMzraCTUuw&e=>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190618/2fc519a5/attachment.html>


More information about the CMake mailing list