# Short target names and exports

**URL:** https://discourse.cmake.org/t/short-target-names-and-exports/2107
**Category:** Usage
**Created:** [November 2, 2020, 10:56am UTC](https://discourse.cmake.org/t/short-target-names-and-exports/2107 "2020-11-02T10:56:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![eiband](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/e/aca169/32.png) [@eiband](https://discourse.cmake.org/u/eiband)
#### Post date: [November 2, 2020, 10:56am UTC](https://discourse.cmake.org/t/short-target-names-and-exports/2107/1 "2020-11-02T10:56:04Z")

</div>

Is it okay to use short target names such as “base” in libraries as long as they are unique to the library? The imported targets are made unique with a namespace prefix, e.g. `Prefix::base`.

Background: Target names could be made more unique by also prepending the prefix, e.g. `prefix-base`, however when using `install(TARGETS prefix-base)` together with `install(EXPORT NAMESPACE Prefix::)` I end up with the imported target name `Prefix::prefix-base`. I would prefer the name `Prefix::base`.

The generic name “base” on the other hand makes collisions with other projects likely when added as subdirectory. Is there another way to realize the imported target name `Prefix::base` in my CMake package while keeping my target name `prefix-base`?

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [November 2, 2020, 7:24pm UTC](https://discourse.cmake.org/t/short-target-names-and-exports/2107/2 "2020-11-02T19:24:30Z")

</div>

You probably want the [`EXPORT_NAME`](https://cmake.org/cmake/help/latest/prop_tgt/EXPORT_NAME.html) target property.

---

<div class="post-metadata">

### Author: ![eiband](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/e/aca169/32.png) [@eiband](https://discourse.cmake.org/u/eiband)
#### Post date: [November 2, 2020, 7:45pm UTC](https://discourse.cmake.org/t/short-target-names-and-exports/2107/3 "2020-11-02T19:45:11Z")

</div>

There is a property for everything 🙂 Thanks a lot, this is exactly what I was looking for.
