# Allow export of IMPORTED libraries?

**URL:** https://discourse.cmake.org/t/allow-export-of-imported-libraries/13088
**Category:** Development
**Created:** [November 28, 2024, 3:20pm UTC](https://discourse.cmake.org/t/allow-export-of-imported-libraries/13088 "2024-11-28T15:20:51Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![mblanchard](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ee59a6/32.png) [@mblanchard](https://discourse.cmake.org/u/mblanchard)
#### Post date: [December 10, 2024, 3:24pm UTC](https://discourse.cmake.org/t/allow-export-of-imported-libraries/13088/4 "2024-12-10T15:24:47Z")

</div>

> [@brad.king](#):
>
> The whole install tree can be deployed to another directory or even another machine, and still work correctly. When the targets file generated by `install(EXPORT)` is loaded by a dependent project, it computes artifact locations relative to itself and generates imported targets for the consumer. It can do this because the install tree layout is known relative to its prefix. This doesn’t work for third-party imports because they come from an arbitrary location on the system and their location after deployment is not known. Maybe the files will be part of the package. Maybe they need to be found again on the destination system with new `find_*` calls. `install(EXPORT)` doesn’t know.

What about `IMPORTED` targets exported from the build-tree with `export(TARGETS...)`? Is that also not allowed by design? I haven’t been quite able to do it, but not sure if not possible or just a problem with my project…

---

_[View the full topic](https://discourse.cmake.org/t/allow-export-of-imported-libraries/13088)._
