# Can I tell what sources / include dirs / targets are PUBLIC vs PRIVATE in target properties?

**URL:** <https://discourse.cmake.org/t/can-i-tell-what-sources-include-dirs-targets-are-public-vs-private-in-target-properties/5393>\
**Category:** Code\
**Created:** [April 7, 2022, 2:42am UTC](https://discourse.cmake.org/t/can-i-tell-what-sources-include-dirs-targets-are-public-vs-private-in-target-properties/5393 "2022-04-07T02:42:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dwarwick](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dwarwick/32/2298_2.png) [@dwarwick](https://discourse.cmake.org/u/dwarwick)\
**Post date:** [April 7, 2022, 2:42am UTC](https://discourse.cmake.org/t/can-i-tell-what-sources-include-dirs-targets-are-public-vs-private-in-target-properties/5393/1 "2022-04-07T02:42:54Z")

</div>

It’s possible to read the sources / include dirs / target dependencies of a target via target properties like [SOURCES](https://cmake.org/cmake/help/latest/prop_tgt/SOURCES.html) and [LINK\_LIIBRARIES](https://cmake.org/cmake/help/latest/prop_tgt/LINK_LIBRARIES.html). This doesn’t tell me whether these are PUBLIC or PRIVATE though. Is there a way to get this information through CMake?

---

<div class="post-metadata">

**Author:** ![benthevining](https://discourse.cmake.org/user_avatar/discourse.cmake.org/benthevining/32/1924_2.png) [@benthevining](https://discourse.cmake.org/u/benthevining)\
**Post date:** [April 7, 2022, 4:10am UTC](https://discourse.cmake.org/t/can-i-tell-what-sources-include-dirs-targets-are-public-vs-private-in-target-properties/5393/2 "2022-04-07T04:10:49Z")

</div>

Public simply means that the sources populate both the `SOURCES` and the `INTERFACE_SOURCES` properties. I’m not sure if there’s a way to retrieve the list of sources specified as public, but you could probably reconstruct it by getting the `SOURCES` and `INTERFACE_SOURCES` properties and finding the sources that are present in both.
