# How to install an interface library with generated source in build folder

**URL:** https://discourse.cmake.org/t/how-to-install-an-interface-library-with-generated-source-in-build-folder/5449
**Category:** Usage
**Tags:** os:linux, os:windows
**Created:** [April 12, 2022, 3:16pm UTC](https://discourse.cmake.org/t/how-to-install-an-interface-library-with-generated-source-in-build-folder/5449 "2022-04-12T15:16:44Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [April 12, 2022, 4:15pm UTC](https://discourse.cmake.org/t/how-to-install-an-interface-library-with-generated-source-in-build-folder/5449/2 "2022-04-12T16:15:48Z")

</div>

> [@gabyx](#):
>
> `target_sources(${linkTarget} PUBLIC ${generatedFile})`

To do this, you should use CMake 3.23’s [`FILE_SET`](https://cmake.org/cmake/help/latest/command/target_sources.html#file-sets) feature. If you need older versions, just make it `PRIVATE` and make a manual `install(FILES)` call for the headers.

---

_[View the full topic](https://discourse.cmake.org/t/how-to-install-an-interface-library-with-generated-source-in-build-folder/5449)._
