# Ask for help in reading generator expression

**URL:** https://discourse.cmake.org/t/ask-for-help-in-reading-generator-expression/12920
**Category:** Usage
**Created:** [November 9, 2024, 12:05am UTC](https://discourse.cmake.org/t/ask-for-help-in-reading-generator-expression/12920 "2024-11-09T00:05:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Fabian188](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fabian188/32/2934_2.png) [@Fabian188](https://discourse.cmake.org/u/Fabian188)
#### Post date: [November 9, 2024, 12:05am UTC](https://discourse.cmake.org/t/ask-for-help-in-reading-generator-expression/12920/1 "2024-11-09T00:05:04Z")

</div>

Can I somehow print what this expression sets?

`target_link_libraries(cfs PUBLIC $<LINK_ONLY:MKL::MKL>)`

Thanks

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [November 9, 2024, 4:42am UTC](https://discourse.cmake.org/t/ask-for-help-in-reading-generator-expression/12920/2 "2024-11-09T04:42:35Z")

</div>

> [@PRIVATE target\_link\_libraries on header only imported library results in linkage requirement](https://discourse.cmake.org/t/private-target-link-libraries-on-header-only-imported-library-results-in-linkage-requirement/1350):
>
> Let’s assume I have a library that links privately to an imported, header only library: FindAsio.cmake (unfortunately does not export itself) add\_library(asio::asio INTERFACE IMPORTED) set\_target\_properties(asio::asio PROPERTIES INTERFACE\_INCLUDE\_DIRECTORIES ${Asio\_INCLUDE\_DIR} INTERFACE\_COMPILE\_DEFINITIONS ASIO\_STANDALONE) and then the project of choice: add\_library (fineftp all\_my\_sources.cpp) add\_library (fineftp::fineftp ALIAS fineftp) target\_link\_libraries(fineftp PRIVA…

---

<div class="post-metadata">

### Author: ![Fabian188](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fabian188/32/2934_2.png) [@Fabian188](https://discourse.cmake.org/u/Fabian188)
#### Post date: [November 12, 2024, 11:37am UTC](https://discourse.cmake.org/t/ask-for-help-in-reading-generator-expression/12920/3 "2024-11-12T11:37:33Z")

</div>

Thanks for your reply but honestly do not understand what you want to tell me …

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [November 12, 2024, 6:14pm UTC](https://discourse.cmake.org/t/ask-for-help-in-reading-generator-expression/12920/4 "2024-11-12T18:14:12Z")

</div>

> [@Fabian188](#):
>
> `target_link_libraries(cfs PUBLIC $<LINK_ONLY:MKL::MKL>)`

AFAIK: This prevents **CMake** to force, that a static library your targets are linked to, has to be installed.

see too [How to handle header-only-libraries exported through INTERFACE\_LINK\_LIBRARIES? - Usage - CMake Discourse](https://discourse.cmake.org/t/how-to-handle-header-only-libraries-exported-through-interface-link-libraries/11704)

---

<div class="post-metadata">

### Author: ![Fabian188](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fabian188/32/2934_2.png) [@Fabian188](https://discourse.cmake.org/u/Fabian188)
#### Post date: [November 12, 2024, 9:20pm UTC](https://discourse.cmake.org/t/ask-for-help-in-reading-generator-expression/12920/5 "2024-11-12T21:20:28Z")

</div>

Thanks, this gives me a good starting point.
