# Can the CMake File API provide the necessary information to build a project?

**URL:** https://discourse.cmake.org/t/can-the-cmake-file-api-provide-the-necessary-information-to-build-a-project/8433
**Category:** Usage
**Created:** [June 29, 2023, 1:54pm UTC](https://discourse.cmake.org/t/can-the-cmake-file-api-provide-the-necessary-information-to-build-a-project/8433 "2023-06-29T13:54:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jason\_Cao](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jason_cao/32/3575_2.png) [@Jason\_Cao](https://discourse.cmake.org/u/Jason_Cao)
#### Post date: [June 29, 2023, 1:54pm UTC](https://discourse.cmake.org/t/can-the-cmake-file-api-provide-the-necessary-information-to-build-a-project/8433/1 "2023-06-29T13:54:15Z")

</div>

I would like to use the CMake File API to parse the build targets of a project and retrieve information such as their source files, include paths, compilation options, and so on. My intention is to port this information to my own build system. Is the CMake File API sufficient to provide this information, and is the proposed idea feasible?

---

<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: [June 29, 2023, 9:59pm UTC](https://discourse.cmake.org/t/can-the-cmake-file-api-provide-the-necessary-information-to-build-a-project/8433/2 "2023-06-29T21:59:32Z")

</div>

It sounds like it should be sufficient. You can find a full description of what the file API provides here:

[https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html](https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html)

---

<div class="post-metadata">

### Author: ![starball](https://discourse.cmake.org/user_avatar/discourse.cmake.org/starball/32/3437_2.png) [@starball](https://discourse.cmake.org/u/starball)
#### Post date: [July 7, 2023, 9:40am UTC](https://discourse.cmake.org/t/can-the-cmake-file-api-provide-the-necessary-information-to-build-a-project/8433/3 "2023-07-07T09:40:34Z")

</div>

Isn’t this a situation where one might be interested in implementing a CMake generator?
