# Get information on interface library without sources via CMake File API

**URL:** https://discourse.cmake.org/t/get-information-on-interface-library-without-sources-via-cmake-file-api/13189
**Category:** Usage
**Created:** [December 12, 2024, 10:11am UTC](https://discourse.cmake.org/t/get-information-on-interface-library-without-sources-via-cmake-file-api/13189 "2024-12-12T10:11:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![itavero](https://discourse.cmake.org/user_avatar/discourse.cmake.org/itavero/32/2547_2.png) [@itavero](https://discourse.cmake.org/u/itavero)
#### Post date: [December 12, 2024, 10:11am UTC](https://discourse.cmake.org/t/get-information-on-interface-library-without-sources-via-cmake-file-api/13189/1 "2024-12-12T10:11:21Z")

</div>

I was using the CMake File API to simply have my code analysis tool “ask” what files to analyze for a given target.  
Unfortunately I noticed that if I have an interface library that only has include directories added, but no sources explicitly added, it does not show up in the `targets` array on the codemodel reply.

Any way I can still get these targets and there include directories via the File API?

---

<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: [December 12, 2024, 9:22pm UTC](https://discourse.cmake.org/t/get-information-on-interface-library-without-sources-via-cmake-file-api/13189/2 "2024-12-12T21:22:32Z")

</div>

If an INTERFACE library has no sources of its own, it is not classified as a build system target, and it won’t be included in the file API reply. It’s annoying, but that’s the behavior, and it has come up a few times in discussion of various issues.
