# alias target

**URL:** https://discourse.vtk.org/t/alias-target/8322
**Category:** Support
**Created:** [April 19, 2022, 3:10pm UTC](https://discourse.vtk.org/t/alias-target/8322 "2022-04-19T15:10:25Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![djduke](https://discourse.vtk.org/user_avatar/discourse.vtk.org/djduke/32/2174_2.png) [@djduke](https://discourse.vtk.org/u/djduke)
#### Post date: [April 19, 2022, 3:10pm UTC](https://discourse.vtk.org/t/alias-target/8322/1 "2022-04-19T15:10:25Z")

</div>

I’m getting a cmake error on my module  
target\_link\_libraries can not be used on an ALIAS target.

I’ve gone through the online cmake tutorial, think I understand aliases but cannot see why my command  
is being interpreted as an alias target the offending command  
is  
add\_library(meta ${classes})

thanks,  
David

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [April 19, 2022, 3:41pm UTC](https://discourse.vtk.org/t/alias-target/8322/2 "2022-04-19T15:41:39Z")

</div>

Could you provide more context here? I suspect you are making a VTK module and trying to use CMake’s `target_*` commands. VTK modules have a layer of abstraction on top (to handle kits) and `vtk_module_link` should be used instead with the module name.

---

<div class="post-metadata">

### Author: ![djduke](https://discourse.vtk.org/user_avatar/discourse.vtk.org/djduke/32/2174_2.png) [@djduke](https://discourse.vtk.org/u/djduke)
#### Post date: [April 19, 2022, 4:22pm UTC](https://discourse.vtk.org/t/alias-target/8322/3 "2022-04-19T16:22:53Z")

</div>

Yes I’m trying to build my own module. I’m attaching the CMakeLists.txt file.  
I thught module and target names were separate.

[CMakeLists.txt](https://discourse.vtk.org/uploads/short-url/9JmbI5OeDcTIX7zdk30U5DNkhR5.txt) (2.42 KB)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [April 19, 2022, 6:42pm UTC](https://discourse.vtk.org/t/alias-target/8322/4 "2022-04-19T18:42:48Z")

</div>

They are; that’s why there are the `vtk_module_*` commands which take module names instead of target names. These commands strip off the `ALIAS` and set it on the actual underlying target which might not be the part after `::` due to kits “renaming” the underlying target to have a suffix of `-objects`. `vtk_module_link` also needs to do some bookkeeping for `PRIVATE` link libraries to make them work as well.
